Haha-Yes/commands/general/randomizer.js

34 lines
687 B
JavaScript
Raw Normal View History

2020-03-22 20:18:40 +01:00
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))]);
2020-03-22 20:18:40 +01:00
}
}
module.exports = randomizerCommand;