mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 07:46:43 +02:00
28 lines
804 B
JavaScript
28 lines
804 B
JavaScript
const { Command } = require('discord.js-commando');
|
|
|
|
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'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, args) {
|
|
const { value } = args;
|
|
const roll = Math.floor(Math.random() * value) + 1;
|
|
return msg.say(`You rolled a ${roll}.`);
|
|
}
|
|
};
|