From 8938536120e21cd7418cd57a7480e9c372aa9a68 Mon Sep 17 00:00:00 2001 From: Anthony M <47640864+IDeletedSystem64@users.noreply.github.com> Date: Fri, 5 Feb 2021 21:59:24 -0600 Subject: [PATCH] Final 8ball, Thanks to @OfficialTCGMatt for helping with this. --- commands/8ball.js | 75 ++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/commands/8ball.js b/commands/8ball.js index 0e5f6af..2132040 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -1,38 +1,39 @@ -module.exports = { - name: '8ball', - description: 'Ask Anitrox a question, any question! and they will answer it!', - execute(client, message, args) { - const answers = [ - "Heck no!", - "Are you crazy? No!", - "Don't even think about it.", - "No! You might bork something!", - "Heck yeah", - "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", - "Definitely!", - "Go for it! :smile:" - // This should have a 50/50 amount of yes and no answers for equality. - ] - const index = Math.floor(Math.random() * (answers.length - 1) + 1); - const question = message.content - var answer = (answers[index]); - - const embed = { - "title": ":8ball: Anitrox 8 Ball", - "description": "**" + question + "**", - "color": 6942950, - "footer": { - "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png", - "text": "Made with :heart: in Illinois | Anitrox (C) IDeletedSystem64 2018-2021" - }, - - "fields": [ - { - "name": "🤔 My Answer", - "value": answer - } - ] - }; - message.channel.send({ embed }); - } +module.exports = { + name: '8ball', + description: 'Ask Anitrox a question, any question! and they will answer it!', + execute(client, message, args) { + const answers = [ + "Heck no!", + "Are you crazy!? No!", + "Don't even think about it.", + "No! You might bork something!", + "Heck yeah", + "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", + "Definitely!", + "Go for it! :smile:" + // This should have a 50/50 amount of yes and no answers for equality even though anitrox doesn't seem to care 🙃 + ] + const index = Math.floor(Math.random() * (answers.length - 1) + 1); + var question = args.slice(0).join(" ") + var answer = (answers[index]); + console.log(args); + + const embed = { + "title": ":8ball: Anitrox 8 Ball", + "description": "Your question: **" + question + "**", + "color": 6942950, + "footer": { + "icon_url": "https://images-ext-2.discordapp.net/external/-qaO3jaZLojhEnjrHiKABdXD7gLWqFvdUqHdskNGWhE/https/media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png", + "text": "Made with ❤ in Illinois | Anitrox © 2018-2021 IDeletedSystem64" + }, + + "fields": [ + { + "name": "🤔 My Answer", + "value": answer + } + ] + }; + message.channel.send({ embed }); + } } \ No newline at end of file