mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 15:57:54 +02:00
23
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class RollCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'roll',
|
||||
aliases: ['dice'],
|
||||
group: 'random-res',
|
||||
memberName: 'roll',
|
||||
description: 'Rolls a dice with a maximum value of your choice.',
|
||||
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}.`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user