2022-06-27 09:46:15 +01:00
|
|
|
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)]}`)
|
2022-06-27 15:15:25 +01:00
|
|
|
interaction.reply({ embeds: [embed]});
|
2022-06-27 09:46:15 +01:00
|
|
|
},
|
|
|
|
};
|