From 6e97735c0f9bf7cf93d65e4f11bb778efd796caa Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 9 Sep 2018 16:56:39 +0200 Subject: [PATCH] Choose dont need to put manually the number again... hope it will work --- commands/fun/badmeme.js | 2 +- commands/fun/despacito.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/fun/badmeme.js b/commands/fun/badmeme.js index 56ce342..52d38b0 100644 --- a/commands/fun/badmeme.js +++ b/commands/fun/badmeme.js @@ -11,7 +11,7 @@ module.exports = class BadmemeCommand extends Command { } run(message) { - const number = 17; + const number = Object.keys(responseObject).length; const picNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; message.channel.send(`${picNumber}: ${responseObject[picNumber]}`); } diff --git a/commands/fun/despacito.js b/commands/fun/despacito.js index f38cddf..fe24d5a 100644 --- a/commands/fun/despacito.js +++ b/commands/fun/despacito.js @@ -11,7 +11,7 @@ module.exports = class DespacitoCommand extends Command { } run(message) { - const number = 8; + const number = Object.keys(responseObject).length; const vidNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; message.channel.send(`${vidNumber}: ${responseObject[vidNumber]}`); }