Added Slah Command - 8Ball

imgbot
KieranRobson 2022-06-27 09:46:15 +01:00
parent f04c2fd77e
commit f3c7bd62ce
1 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,41 @@
const { Client, CommandInteraction, MessageEmbed } = require("discord.js");
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
...new SlashCommandBuilder()
.setName('8ball')
.setDescription('Answer your deepest questions')
.addStringOption((option) => option
.setName('question')
.setDescription("Your question")
.setRequired(true)
),
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args) => {
const questionToSend = interaction.options.getString("question")
const Responses = [
"Yes",
"No",
"Maybe",
"It is likely",
"It is unlikely"
];
const embed = new MessageEmbed()
.setColor('GREEN')
.setFooter(`Called By: ${interaction.user.tag}`)
.setTimestamp()
.setTitle("8ball")
.addField(`${questionToSend}`,`${Responses[Math.floor(Math.random() * Responses.length)]}`)
interaction.followUp({ embeds: [embed]});
},
};