This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
anitrox/commands/8ball.js

30 lines
968 B
JavaScript
Raw Normal View History

module.exports = {
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]
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: {
2022-03-29 11:06:04 -05:00
"title": ":8ball: 8Ball",
"description": `Your amazing question: **${question}**`,
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
2022-03-29 11:06:04 -05:00
"text": config.footerTxt
},
"fields": [
{
2022-03-29 11:06:04 -05:00
"name": "Answer",
"value": `${answer}`
}
]
}});
}
}
}