aboutsummaryrefslogtreecommitdiff
path: root/src/commands/config/config.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-04-20 18:37:22 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-04-20 18:37:22 -0400
commitf01be2e3ce820e5737416180efa3e5852ece72c4 (patch)
treea972af929940173e4e2d9f843124a8dfb293bc90 /src/commands/config/config.ts
parentbcb3dc5fcd21f7626d4c5a8c009dca5658a4436b (diff)
downloadtanzanite-f01be2e3ce820e5737416180efa3e5852ece72c4.tar.gz
tanzanite-f01be2e3ce820e5737416180efa3e5852ece72c4.tar.bz2
tanzanite-f01be2e3ce820e5737416180efa3e5852ece72c4.zip
fix invite link, remove store channel, update to use builder methods, fix breaking changes
Diffstat (limited to 'src/commands/config/config.ts')
-rw-r--r--src/commands/config/config.ts31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index a90a267..c1dd142 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -12,19 +12,19 @@ import {
import assert from 'assert';
import { type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo';
import {
- ActionRow,
+ ActionRowBuilder,
ApplicationCommandOptionType,
- ButtonComponent,
+ ButtonBuilder,
ButtonStyle,
Channel,
- Embed,
+ EmbedBuilder,
Formatters,
GuildMember,
InteractionUpdateOptions,
PermissionFlagsBits,
Role,
- SelectMenuComponent,
- SelectMenuOption,
+ SelectMenuBuilder,
+ UnsafeSelectMenuOptionBuilder,
User,
type Message,
type MessageComponentInteraction,
@@ -285,18 +285,21 @@ export default class ConfigCommand extends BushCommand {
case 'command_settingsSel': {
if (!interaction.isSelectMenu()) return;
- return interaction.update(
+ await interaction.update(
await this.generateMessageOptions(message, interaction.values[0] as keyof typeof guildSettingsObj)
);
+ return;
}
case 'command_settingsBack': {
if (!interaction.isButton()) return;
- return interaction.update(await this.generateMessageOptions(message));
+ await interaction.update(await this.generateMessageOptions(message));
+ return;
}
}
} else {
- return await interaction?.deferUpdate().catch(() => undefined);
+ await interaction?.deferUpdate().catch(() => undefined);
+ return;
}
});
}
@@ -307,17 +310,17 @@ export default class ConfigCommand extends BushCommand {
): Promise<MessageOptions & InteractionUpdateOptions> {
assert(message.inGuild());
- const settingsEmbed = new Embed().setColor(util.colors.default);
+ const settingsEmbed = new EmbedBuilder().setColor(util.colors.default);
if (!setting) {
settingsEmbed.setTitle(`${message.guild.name}'s Settings`);
const desc = settingsArr.map((s) => `:wrench: **${guildSettingsObj[s].name}**`).join('\n');
settingsEmbed.setDescription(desc);
- const selMenu = new ActionRow().addComponents(
- new SelectMenuComponent()
+ const selMenu = new ActionRowBuilder<SelectMenuBuilder>().addComponents(
+ new SelectMenuBuilder()
.addOptions(
...settingsArr.map((s) =>
- new SelectMenuOption()
+ new UnsafeSelectMenuOptionBuilder()
.setLabel(guildSettingsObj[s].name)
.setValue(s)
.setDescription(guildSettingsObj[s].description)
@@ -360,8 +363,8 @@ export default class ConfigCommand extends BushCommand {
: '[No Value Set]';
};
- const components = new ActionRow().addComponents(
- new ButtonComponent({ style: ButtonStyle.Primary, customId: 'command_settingsBack', label: 'Back' })
+ const components = new ActionRowBuilder<ButtonBuilder>().addComponents(
+ new ButtonBuilder({ style: ButtonStyle.Primary, customId: 'command_settingsBack', label: 'Back' })
);
settingsEmbed.setDescription(
`${Formatters.italic(guildSettingsObj[setting].description)}\n\n**Type:** ${guildSettingsObj[setting].type}`