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