2021-02-05 21:59:24 -06:00
|
|
|
module.exports = {
|
2022-03-26 03:33:18 -05:00
|
|
|
name: '8ball',
|
|
|
|
description: 'Ask Anitrox a question, any question! and they will answer it!',
|
|
|
|
syntax: ["[Question]"],
|
2022-03-29 11:06:04 -05:00
|
|
|
async execute(client, message, args, config) {
|
|
|
|
const index = Math.floor(Math.random() * config.answers.length);
|
|
|
|
const answer = config.answers[index]
|
2022-03-26 03:33:18 -05:00
|
|
|
const question = args.slice(0).join(" ")
|
2021-02-05 21:59:24 -06:00
|
|
|
|
2022-03-26 03:33:18 -05:00
|
|
|
if (!question) {
|
2022-03-26 12:31:03 -05:00
|
|
|
await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL));
|
2022-03-26 03:33:18 -05:00
|
|
|
} else {
|
2022-03-26 11:02:17 -05:00
|
|
|
await message.channel.send({embed: {
|
2022-03-29 11:06:04 -05:00
|
|
|
"title": ":8ball: 8Ball",
|
|
|
|
"description": `Your amazing question: **${question}**`,
|
2022-03-26 03:33:18 -05:00
|
|
|
"color": 9442302,
|
2022-03-26 12:31:03 -05:00
|
|
|
"footer": {
|
|
|
|
"icon_url": message.author.displayAvatarURL(),
|
2022-03-29 11:06:04 -05:00
|
|
|
"text": config.footerTxt
|
2022-03-26 12:31:03 -05:00
|
|
|
},
|
2022-03-26 03:33:18 -05:00
|
|
|
"fields": [
|
|
|
|
{
|
2022-03-29 11:06:04 -05:00
|
|
|
"name": "Answer",
|
|
|
|
"value": `${answer}`
|
2022-03-26 03:33:18 -05:00
|
|
|
}
|
|
|
|
]
|
2022-03-26 11:02:17 -05:00
|
|
|
}});
|
2021-02-05 21:59:24 -06:00
|
|
|
}
|
2022-03-26 03:33:18 -05:00
|
|
|
}
|
2021-02-05 01:33:25 -06:00
|
|
|
}
|