Skip to content

Instantly share code, notes, and snippets.

@rmassengale
Created September 7, 2017 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmassengale/a8f9ead72272f799b0bac517df75bf16 to your computer and use it in GitHub Desktop.
Save rmassengale/a8f9ead72272f799b0bac517df75bf16 to your computer and use it in GitHub Desktop.
const commando = require('discord.js-commando');
class DiceRollCommand extends commando.Command {
constructor(client) {
super(client, {
name: 'roll',
group: 'random',
memberName: 'roll',
description: 'Rolls a die'
});
}
async run(message, args) {
var roll = Math.floor(Math.random() * 6) + 1;
message.reply("You rolled a " + roll);
}
}
module.exports = DiceRollCommand;
const commando = require('discord.js-commando');
const bot = new commando.Client();
bot.registry.registerGroup('random', 'Random');
bot.registry.registerDefaults();
bot.registry.registerCommandsIn(__dirname + "/commands");
bot.login('MzU1MTI2MzcyMTg1ODAwNzE2.DJJTLg.CfjBgPTZ3Uh9PiCRNhLzgvonba4');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment