Haha-Yes/commands/general/randomizer.js
supositware dfd25c8bf2 Bunch of update
mostly replacing message.channel.send with message.reply
( i hope it work this time... )
2021-07-23 04:19:47 +02:00

34 lines
No EOL
687 B
JavaScript

const { Command } = require('discord-akairo');
class randomizerCommand extends Command {
constructor() {
super('randomizer', {
aliases: ['randomizer'],
category: 'general',
clientPermissions: ['SEND_MESSAGES'],
args: [
{
id: 'text',
type: 'string',
prompt: {
start: 'Need words to randomize',
},
match: 'rest'
}
],
description: {
content: 'Choose one random word',
usage: '[multiples words]',
examples: ['Hello bye']
}
});
}
async exec(message, args) {
let words = args.text.split(' ');
return message.reply(words[Math.floor((Math.random() * words.length))]);
}
}
module.exports = randomizerCommand;