Browse Source

Update settings.ts

pull/43/head
Eric Yang 3 years ago
parent
commit
34d0bef112
  1. 39
      src/commands/settings.ts

39
src/commands/settings.ts

@ -6,11 +6,31 @@ import log from '../helpers/log';
export const data = new SlashCommandBuilder()
.setName('settings')
.setDescription('BETA - settings configuration');
.setDescription('BETA - settings configuration')
.addSubcommand(subcommand => {
subcommand
.setName('subject')
.setDescription('Changes subject of problems');
return subcommand;
})
.addSubcommand(subcommand => {
subcommand
.setName('gradeLevels')
.setDescription('Changes grade level of problems');
return subcommand;
})
.addSubcommand(subcommand => {
subcommand
.setName('display')
.setDescription('Displays current settings');
return subcommand;
});
export async function execute(interaction : CommandInteraction) {
await interaction.deferReply();
const action = interaction.options.getSubcommand();
switch (action) {
case 'display': {
await interaction.deferReply({ ephemeral: true });
const settingsEmbed = new MessageEmbed()
.setColor('#ffffff');
@ -42,10 +62,9 @@ export async function execute(interaction : CommandInteraction) {
await interaction.followUp({ embeds: [settingsEmbed], components: [menu] });
//everything below this line is bad
client.on('interactionCreate', async interaction => {
if (!interaction.isSelectMenu()) return;
var values = interaction.values[0]; //potential breaking point
var values = interaction.values[0];
switch(values) {
case 'subjects':
await interaction.update({ content: 'subjects was selected!', components: [] });
@ -55,5 +74,13 @@ export async function execute(interaction : CommandInteraction) {
break;
}
});
break;
}
case 'gradeLevels': {
break;
}
case 'subject': {
break;
}
}
}
Loading…
Cancel
Save