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

33 lines
1019 B
JavaScript
Raw Normal View History

module.exports = {
name: require('path').parse(__filename).name,
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(" ")
const avatarURL = message.author.displayAvatarURL()
if (!question) {
await message.channel.send(client.generateErrorMessage("You need to ask a question!", avatarURL));
} else {
await message.channel.send({embeds: [{
2022-03-29 11:06:04 -05:00
"title": ":8ball: 8Ball",
"description": `Your amazing question: **${question}**`,
"color": 9442302,
"footer": {
"icon_url": avatarURL,
2022-03-29 11:06:04 -05:00
"text": config.footerTxt
},
"fields": [
{
2022-03-29 11:06:04 -05:00
"name": "Answer",
"value": `${answer}`
}
]
}]});
}
}
}