From f3c7bd62cec6d153ff60bb5c6cc30d1cf29b01a3 Mon Sep 17 00:00:00 2001 From: KieranRobson Date: Mon, 27 Jun 2022 09:46:15 +0100 Subject: [PATCH] Added Slah Command - 8Ball --- SlashCommands/fun/8ball.js | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 SlashCommands/fun/8ball.js diff --git a/SlashCommands/fun/8ball.js b/SlashCommands/fun/8ball.js new file mode 100644 index 0000000..0403690 --- /dev/null +++ b/SlashCommands/fun/8ball.js @@ -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]}); + }, +}; \ No newline at end of file