From 4a29ebba28903f8c692ca83f32f4d88383e3ffd4 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Mon, 30 Aug 2021 21:21:20 -0600 Subject: [PATCH] /8ball + bug --- commands/misc/userinfo.js | 2 +- slash/8ball.js | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 slash/8ball.js diff --git a/commands/misc/userinfo.js b/commands/misc/userinfo.js index df73b00..fd7267d 100644 --- a/commands/misc/userinfo.js +++ b/commands/misc/userinfo.js @@ -40,6 +40,6 @@ module.exports = { .addField('Donator?', tu.developer ? `Well, ${name} makes me work, so they're a supporter in my book!` : tu.donator ? 'Yes! They have donated or supported me in the past!' : 'No', true) .addField('Natsuki Staff Level', tu.developer ? 'Developer' : tu.admin ? 'Admin; Audit access to the bot' : tu.staff ? 'Staff; Support but with maintenance permissions' : tu.support ? 'Support; Answers tickets and help queries' : 'Member; Does not have a staff rank.', true); } - return message.channel.send(infoembed); + return message.channel.send({embeds: [infoembed]}); } }; \ No newline at end of file diff --git a/slash/8ball.js b/slash/8ball.js new file mode 100644 index 0000000..5f3e950 --- /dev/null +++ b/slash/8ball.js @@ -0,0 +1,35 @@ +const {SlashCommand} = require('../util/slash'); +const {SlashCommandBuilder} = require('@discordjs/builders'); +const Discord = require('discord.js'); + +module.exports = (client) => { + return new SlashCommand('8ball', client, + new SlashCommandBuilder() + .setName('8ball') + .setDescription("Get a totally accurate and well-thought-out answer to your life's troubles.") + .addStringOption(option => { + return option.setName("question") + .setDescription("Your existential crisis.") + .setRequired(true); + }) + .addBooleanOption(option => { + return option.setName("send") + .setDescription("Should I send the answer to the channel?"); + }), + + async (client, interaction) => { + const responses = [ + /*Positive Responses*/ "Yes!", "I think so", "Possibly", "Certainly", "Definitely", "Absolutely", "Sure!", "Most Likely", "I believe so", "If you're asking for my honest opinion... yes" + /*Negative Responses*/ ,"No!", "I don't think so", "Probably not", "Impossible", "Nope", "Absolutely *not*", "Nah", "Doubt it", "I don't believe so", "If you're asking for my honest opinion... no" + /*Neutral Responses */ ,"Maybe", "I'm not sure", "I'll think about it", "Uhh Natsuki isn't here right now. I can take a message?", "I'm sure if you look deep within your heart, which is currently all over that tree, you'll find the answer", "I mean, if you think so...", "I don't have an opinion on that.", "I'll choose to remain silent." + ]; + return await interaction.reply({embeds: [new Discord.MessageEmbed() + .setAuthor("8ball Question", interaction.user.avatarURL()) + .setDescription("**Question:** " + interaction.options.getString('question') + "\n**Answer:** " + responses[Math.floor(Math.random() * responses.length)]) + .setColor("c375f0") + .setFooter(`Asked by ${interaction.guild ? interaction.member.displayName : interaction.user.username} | Natsuki`) + .setTimestamp() + ], ephemeral: !interaction.options.getBoolean("send")}); + } + ); +}; \ No newline at end of file