From 0be22e6a29f51bf72c65c3e67c9198a63e12875d Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Sat, 20 Jan 2024 22:37:57 +0530 Subject: [PATCH] Update FindEmoji.js Code doesn't work if number of emojis is less than 8. --- src/FindEmoji.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FindEmoji.js b/src/FindEmoji.js index 507865e..b0a4142 100644 --- a/src/FindEmoji.js +++ b/src/FindEmoji.js @@ -21,6 +21,7 @@ module.exports = class FindEmoji extends events { if (!options.timeoutTime) options.timeoutTime = 60000; if (!options.hideEmojiTime) options.hideEmojiTime = 5000; if (!options.buttonStyle) options.buttonStyle = 'PRIMARY'; + if (options.emojis && option.emojis.length < 8) throw new TypeError('LESS_EMOJIS: The number of emojis must be 8 or greater.'); if (!options.emojis) options.emojis = ['🍉', '🍇', '🍊', '🍋', '🥭', '🍎', '🍏', '🥝', '🥥', '🍓', '🍒']; if (!options.winMessage) options.winMessage = 'You won! You selected the correct emoji. {emoji}'; @@ -138,4 +139,4 @@ module.exports = class FindEmoji extends events { } return components; } -} \ No newline at end of file +}