Files
xiao/commands/response/roll.js
T
Daniel Odendahl Jr 14f85f94bd 22.0.0
2017-06-01 08:44:02 +00:00

29 lines
837 B
JavaScript

const Command = require('../../structures/Command');
module.exports = class RollCommand extends Command {
constructor(client) {
super(client, {
name: 'roll',
aliases: ['dice'],
group: 'response',
memberName: 'roll',
description: 'Rolls a dice with a maximum value you specify.',
args: [
{
key: 'value',
label: 'maximum number',
prompt: 'What is the maximum number you wish to appear?',
type: 'integer',
default: 6
}
]
});
}
run(msg, args) {
const { value } = args;
const roll = Math.floor(Math.random() * value) + 1;
return msg.say(`You rolled a ${roll}.`);
}
};