choose one random word
This commit is contained in:
parent
422cf38dd5
commit
fa9f2437ed
1 changed files with 34 additions and 0 deletions
34
commands/general/randomizer.js
Normal file
34
commands/general/randomizer.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
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.channel.send(words[Math.floor((Math.random() * words.length))]);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = randomizerCommand;
|
Loading…
Reference in a new issue