added 1 aliases and allow user to change number of ingredient or time

This commit is contained in:
loicbersier 2019-06-17 23:07:43 +02:00
parent 3ae86dec36
commit fe602510e5

View file

@ -8,20 +8,32 @@ const { MessageEmbed } = require('discord.js');
class borgarCommand extends Command { class borgarCommand extends Command {
constructor() { constructor() {
super('borgar', { super('borgar', {
aliases: ['borgar', 'hamburgor', 'hamborgar', 'burger'], aliases: ['borgar', 'hamburgor', 'hamborgar', 'burger', 'hamburger'],
category: 'minigame', category: 'minigame',
args: [
{
id: 'IngredientNumber',
type: 'int',
default: 4
},
{
id: 'Time',
type: 'int',
default: 10000
}
],
description: { description: {
content: 'Make amborgar,,,,,,,,,, ( MINI GAME VERY WIP, NO LEVEL YET )', content: 'Make amborgar,,,,,,,,,, ( MINI GAME VERY WIP, NO LEVEL YET )',
usage: '', usage: '[number of ingredient] [time in miliseconds]',
examples: [''] examples: ['4 10000']
} }
}); });
} }
async exec(message) { async exec(message, args) {
const ingredient = [ 'bun', 'beef', 'salade', 'tomato', 'cheese', 'pickle']; const ingredient = [ 'bun', 'beef', 'salade', 'tomato', 'cheese', 'pickle'];
let hamIngredient = []; let hamIngredient = [];
for (let i = 0; i < 4; i++) { for (let i = 0; i < args.IngredientNumber; i++) {
hamIngredient[i] = ingredient[Math.floor( Math.random() * ingredient.length )]; hamIngredient[i] = ingredient[Math.floor( Math.random() * ingredient.length )];
} }