diff --git a/src/discord/MusicPlayer/Join.ts b/src/discord/MusicPlayer/Join.ts index 1e72a67..45fa94e 100644 --- a/src/discord/MusicPlayer/Join.ts +++ b/src/discord/MusicPlayer/Join.ts @@ -119,7 +119,7 @@ export async function joinVoiceChannelProcedure( voiceChannel: VoiceChannel | StageChannel ) { const isSlashCommand = data.isApplicationCommand(); - const isAcceptableInteraction = data.isSelectMenu() || data.isButton(); + const isAcceptableInteraction = data.isStringSelectMenu() || data.isButton(); const isMessage = data.isMessage(); if (!isSlashCommand && !isAcceptableInteraction && !isMessage) return; diff --git a/src/discord/MusicPlayer/Play.ts b/src/discord/MusicPlayer/Play.ts index 990805a..fe29e81 100644 --- a/src/discord/MusicPlayer/Play.ts +++ b/src/discord/MusicPlayer/Play.ts @@ -187,8 +187,8 @@ export default class Play extends DiscordModule { instance.addTrackToQueue(song); } - if (hybridData.getSelectMenu().message instanceof Message) - await (hybridData.getSelectMenu().message as Message).edit({ components: [] }); + if (hybridData.getStringSelectMenu().message instanceof Message) + await (hybridData.getStringSelectMenu().message as Message).edit({ components: [] }); return await sendHybridInteractionMessageResponse( hybridData, diff --git a/src/discord/MusicPlayer/Search.ts b/src/discord/MusicPlayer/Search.ts index 94b3dc1..c1a8848 100644 --- a/src/discord/MusicPlayer/Search.ts +++ b/src/discord/MusicPlayer/Search.ts @@ -3,7 +3,7 @@ import { CommandInteraction, ActionRowBuilder, ButtonInteraction, - SelectMenuBuilder, + StringSelectMenuBuilder, SelectMenuComponentOptionData } from 'discord.js'; import { I18n } from 'i18n'; @@ -137,7 +137,7 @@ export default class Search extends DiscordModule { const menuOptions: SelectMenuComponentOptionData[] = []; - const messageSelectMenu = new SelectMenuBuilder(); + const messageSelectMenu = new StringSelectMenuBuilder(); /* Discord have 100 char custom id char limit So we need to shorten our json. @@ -168,7 +168,7 @@ export default class Search extends DiscordModule { messageSelectMenu.addOptions(menuOptions); - const row = new ActionRowBuilder(); + const row = new ActionRowBuilder(); row.addComponents([messageSelectMenu]); return await sendHybridInteractionMessageResponse(data, { diff --git a/src/providers/Discord.ts b/src/providers/Discord.ts index 39b4fee..5bb7bfe 100644 --- a/src/providers/Discord.ts +++ b/src/providers/Discord.ts @@ -178,7 +178,7 @@ class Discord { `Triggering 'GuildButtonInteractionCreate' event for module ${thisModule.constructor.name}` ); thisModule.GuildButtonInteractionCreate(interaction); - } else if (interaction.isSelectMenu()) { + } else if (interaction.isStringSelectMenu()) { Logger.verbose( LOGGING_TAG, `Triggering 'GuildSelectMenuInteractionCreate' event for module ${thisModule.constructor.name}` diff --git a/src/utils/DiscordMessage.ts b/src/utils/DiscordMessage.ts index 817e7ae..340b724 100644 --- a/src/utils/DiscordMessage.ts +++ b/src/utils/DiscordMessage.ts @@ -176,7 +176,7 @@ export async function sendHybridInteractionMessageResponse( ): Promise { Logger.verbose(LOGGING_TAG, `Sending hybrid interaction message response, ${JSON.stringify(payload)})}`); - if (data.isApplicationCommand() || data.isButton() || data.isSelectMenu()) { + if (data.isApplicationCommand() || data.isButton() || data.isStringSelectMenu()) { const messageComponent = data.getMessageComponentInteraction(); if (!messageComponent.replied) { diff --git a/src/utils/DiscordModule.ts b/src/utils/DiscordModule.ts index 0ce9030..4f6eef5 100644 --- a/src/utils/DiscordModule.ts +++ b/src/utils/DiscordModule.ts @@ -8,7 +8,7 @@ import { TextBasedChannel, MessageComponentInteraction, User, - SelectMenuInteraction, + StringSelectMenuInteraction, InteractionType, BaseInteraction, GuildBasedChannel, @@ -46,7 +46,7 @@ export default class DiscordModule { GuildCommandInteractionCreate(interaction: CommandInteraction): void | Promise {} GuildModuleCommandInteractionCreate(interaction: CommandInteraction): void | Promise {} - GuildSelectMenuInteractionCreate(interaction: SelectMenuInteraction): void | Promise {} + GuildSelectMenuInteractionCreate(interaction: StringSelectMenuInteraction): void | Promise {} GuildButtonInteractionCreate(interaction: ButtonInteraction): void | Promise {} @@ -73,8 +73,8 @@ export class HybridInteractionMessage { return this.data instanceof ButtonInteraction && this.data.isButton(); } - public isSelectMenu(): boolean { - return this.data instanceof SelectMenuInteraction && this.data.isSelectMenu(); + public isStringSelectMenu(): boolean { + return this.data instanceof StringSelectMenuInteraction && this.data.isStringSelectMenu(); } public isMessage(): boolean { @@ -117,11 +117,11 @@ export class HybridInteractionMessage { return this.data as CommandInteraction; } - public getSelectMenu(): SelectMenuInteraction { - if (this.isInteraction() && !(this.data as SelectMenuInteraction)) - throw new Error('Unable to cast to SelectMenuInteraction'); + public getStringSelectMenu(): StringSelectMenuInteraction { + if (this.isInteraction() && !(this.data as StringSelectMenuInteraction)) + throw new Error('Unable to cast to StringSelectMenuInteraction'); - return this.data as SelectMenuInteraction; + return this.data as StringSelectMenuInteraction; } public getMessageComponentInteraction(): MessageComponentInteraction {