From bbb4f4459a0ad43312df36c4e436410c90fbc72a Mon Sep 17 00:00:00 2001 From: Eric Yang <64386991+xlq902@users.noreply.github.com> Date: Mon, 11 Apr 2022 23:51:45 -0400 Subject: [PATCH] Revert "still trying to debug :skull:" This reverts commit 45aac13ddf7bfb339b6b32810da068c88488be0f. --- src/commands/settings.ts | 46 ++++++++++++++------------------- src/events/interactionCreate.ts | 13 ---------- 2 files changed, 19 insertions(+), 40 deletions(-) diff --git a/src/commands/settings.ts b/src/commands/settings.ts index 499b566..6da52fb 100644 --- a/src/commands/settings.ts +++ b/src/commands/settings.ts @@ -8,25 +8,14 @@ export const data = new SlashCommandBuilder() .setName('settings') .setDescription('BETA - settings configuration'); + export async function execute(interaction : CommandInteraction) { await interaction.deferReply(); - const testEmbed = new MessageEmbed() - .setColor('#ffffff'); - const testEmbed2 = new MessageEmbed() - .setColor('#ffffff'); const settingsEmbed = new MessageEmbed() .setColor('#ffffff'); const user = interaction.options.getUser('user') || interaction.user; - - testEmbed - .setAuthor({ name: user.tag, iconURL: user.displayAvatarURL() }) - .setDescription(`b`); - - testEmbed2 - .setAuthor({ name: user.tag, iconURL: user.displayAvatarURL() }) - .setDescription(`c`); - + settingsEmbed .setAuthor({ name: user.tag, iconURL: user.displayAvatarURL() }) .setDescription(`a`); @@ -48,17 +37,20 @@ export async function execute(interaction : CommandInteraction) { }, ]), ); - await interaction.followUp({ embeds: [settingsEmbed], components: [menu] }); - client.on('interactionCreate', async interaction => { - if (!interaction.isSelectMenu()) return; - var values = interaction.values[1]; - switch(values) { - case "subjects": - await interaction.reply({ embeds: [testEmbed] }) - break; - case "gradeLevels": - await interaction.reply({ embeds: [testEmbed2] }) - break; - } - }); - } \ No newline at end of file + await interaction.followUp({ embeds: [settingsEmbed], components: [menu] }); + await interaction.deferReply; + const client = interaction.client; + client.on('interactionCreate', async interaction => { + if (!interaction.isSelectMenu()) return; + var values = interaction.values[1]; + switch(values) { + case "subjects": + await interaction.followUp({ content: 'subjects was selected!', components: [] }); + break; + case "gradeLevels": + await interaction.followUp({ content: 'levels was selected!', components: [] }); + break; + } + }); + +} \ No newline at end of file diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index 1b330c7..60cf296 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -15,19 +15,6 @@ export async function execute(interaction) { const command = client.commands.get(interaction.commandName); - client.on('interactionCreate', async interaction => { - if (!interaction.isSelectMenu()) return; - var values = interaction.values[1]; - switch(values) { - case "subjects": - await interaction.editReply({ content: 'subjects was selected!', components: [] }); - break; - case "gradeLevels": - await interaction.editReply({ content: 'levels was selected!', components: [] }); - break; - } - }); - if (!command) return; try {