Move answers to config JSON
This commit is contained in:
parent
9eb8bd3d35
commit
f5f9cdf0e2
2 changed files with 40 additions and 40 deletions
|
@ -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 = {
|
module.exports = {
|
||||||
name: '8ball',
|
name: '8ball',
|
||||||
description: 'Ask Anitrox a question, any question! and they will answer it!',
|
description: 'Ask Anitrox a question, any question! and they will answer it!',
|
||||||
syntax: ["[Question]"],
|
syntax: ["[Question]"],
|
||||||
async execute(client, message, args, footerTxt) {
|
async execute(client, message, args, config) {
|
||||||
const answer = answers[Math.floor(Math.random() * Object.keys(answers).length)];
|
const index = Math.floor(Math.random() * config.answers.length);
|
||||||
|
const answer = config.answers[index]
|
||||||
const question = args.slice(0).join(" ")
|
const question = args.slice(0).join(" ")
|
||||||
|
|
||||||
if (!question) {
|
if (!question) {
|
||||||
await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL));
|
await message.channel.send(client.generateErrorMessage("You need to ask a question!", message.author.displayAvatarURL));
|
||||||
} else {
|
} else {
|
||||||
await message.channel.send({embed: {
|
await message.channel.send({embed: {
|
||||||
"title": ":8ball: Anitrox 8 Ball",
|
"title": ":8ball: 8Ball",
|
||||||
"description": `Your question: **${question}**`,
|
"description": `Your amazing question: **${question}**`,
|
||||||
"color": 9442302,
|
"color": 9442302,
|
||||||
"footer": {
|
"footer": {
|
||||||
"icon_url": message.author.displayAvatarURL(),
|
"icon_url": message.author.displayAvatarURL(),
|
||||||
"text": footerTxt
|
"text": config.footerTxt
|
||||||
},
|
},
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "🤔 My Answer",
|
"name": "Answer",
|
||||||
"value": answer
|
"value": `${answer}`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}});
|
}});
|
||||||
|
|
|
@ -33,5 +33,25 @@
|
||||||
"Mars",
|
"Mars",
|
||||||
"Elon Musk",
|
"Elon Musk",
|
||||||
"TMC Software"
|
"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"
|
||||||
]
|
]
|
||||||
}
|
}
|
Reference in a new issue