diff --git a/src/commands/train.ts b/src/commands/train.ts index 41b386c..1485228 100644 --- a/src/commands/train.ts +++ b/src/commands/train.ts @@ -61,12 +61,12 @@ export async function execute(interaction : CommandInteraction) { }); let categoryArray : string[] = []; + const allCategories = ['BIOLOGY', 'PHYSICS', 'CHEMISTRY', 'EARTH AND SPACE', 'ASTRONOMY', 'MATH']; const configCategories = await userConfig.findById(interaction.user.id); switch (subject) { case null: - // categoryArray = ['BIOLOGY', 'PHYSICS', 'CHEMISTRY', 'EARTH AND SPACE', 'ASTRONOMY', 'MATH']; - categoryArray = configCategories.subjects || ['BIOLOGY', 'PHYSICS', 'CHEMISTRY', 'EARTH AND SPACE', 'ASTRONOMY', 'MATH']; + categoryArray = (configCategories ? (configCategories.subjects || allCategories) : allCategories); break; case 'astro': case 'astronomy': diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index ea5ea28..6692a94 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -18,6 +18,6 @@ export async function execute(interaction) { } catch (error) { log({ logger: 'interaction', content: `Interaction ${interaction.commandName} failed!`, level: 'error' }); - await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); + await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true }); } }