diff --git a/commands/8ball.js b/commands/8ball.js index c514b2e..cd58d94 100644 --- a/commands/8ball.js +++ b/commands/8ball.js @@ -1,47 +1,27 @@ -const answers = [ - "Heck no!", - "Are you crazy!? No!", - "Don't even think about it.", - "No! You might bork something!", - "Heck yeah", - "I don't think so.", - "Let me think about it first. No.", - "Let me think about it first. Yeah", - "Let me think about it first. Maybe", - "I don't know man", - "Maybe", - "I'm not sure", - "Ask again", - "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!", - "Definitely!", - "Go for it! :smile:", - "Good idea!", - "Sure" -] - module.exports = { name: '8ball', description: 'Ask Anitrox a question, any question! and they will answer it!', syntax: ["[Question]"], - async execute(client, message, args, footerTxt) { - const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)]; + async execute(client, message, args, config) { + const index = Math.floor(Math.random() * config.answers.length); + const answer = config.answers[index] const question = args.slice(0).join(" ") if (!question) { await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL)); } else { await message.channel.send({embed: { - "title": ":8ball: Anitrox 8 Ball", - "description": `Your question: **${question}**`, + "title": ":8ball: 8Ball", + "description": `Your amazing question: **${question}**`, "color": 9442302, "footer": { "icon_url": message.author.displayAvatarURL(), - "text": footerTxt + "text": config.footerTxt }, "fields": [ { - "name": "🤔 My Answer", - "value": answer + "name": "Answer", + "value": `${answer}` } ] }}); diff --git a/config-example.json b/config-example.json index e8786e6..47afd8f 100644 --- a/config-example.json +++ b/config-example.json @@ -21,17 +21,37 @@ "VLC Media Player", "Chromium" ], - "locations": [ - "Microsoft", - "LinusTechTips", - "Linus Torvalds", - "borkeonv2", - "Google", - "192.168.1.1", - "127.0.0.1", - "Sophie's computer", - "Mars", - "Elon Musk", - "TMC Software" + "locations": [ + "Microsoft", + "LinusTechTips", + "Linus Torvalds", + "borkeonv2", + "Google", + "192.168.1.1", + "127.0.0.1", + "Sophie's computer", + "Mars", + "Elon Musk", + "TMC Software" + ], + "answers": [ + "Heck no!", + "Are you crazy!? No!", + "Don't even think about it.", + "No! You might bork something!", + "Heck yeah", + "I don't think so.", + "Let me think about it first. No.", + "Let me think about it first. Yeah", + "Let me think about it first. Maybe", + "I don't know man", + "Maybe", + "I'm not sure", + "Ask again", + "YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!", + "Definitely!", + "Go for it! :smile:", + "Good idea!", + "Sure" ] } \ No newline at end of file