From 503f4b7cca9f8757318d720a96b4a122090b5ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Wed, 24 May 2023 00:48:29 +0300 Subject: [PATCH] Discord.js - StringSelectMenu --- src/client/commands/maintenance.js | 4 ++-- src/client/events/interactionCreate.js | 2 +- src/client/funcs/listStations.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/commands/maintenance.js b/src/client/commands/maintenance.js index 066130a..3098cc0 100644 --- a/src/client/commands/maintenance.js +++ b/src/client/commands/maintenance.js @@ -1,4 +1,4 @@ -import { ActionRowBuilder, EmbedBuilder, SelectMenuBuilder } from "discord.js"; +import { ActionRowBuilder, EmbedBuilder, StringSelectMenuBuilder } from "discord.js"; import Streamer from "../classes/Streamer.js"; const _importDynamic = new Function('modulePath', 'return import(modulePath)'); const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args)); @@ -65,7 +65,7 @@ module.exports = { const menu = new ActionRowBuilder() .addComponents( - new SelectMenuBuilder() + new StringSelectMenuBuilder() .setCustomId('maintenance') .setPlaceholder('Select action') .addOptions(options) diff --git a/src/client/events/interactionCreate.js b/src/client/events/interactionCreate.js index 320e974..b368e5f 100644 --- a/src/client/events/interactionCreate.js +++ b/src/client/events/interactionCreate.js @@ -26,7 +26,7 @@ module.exports = { }); console.error(error); } - } else if (interaction.isSelectMenu() || interaction.isButton()){ + } else if (interaction.isStringSelectMenu() || interaction.isButton()){ const commandName = interaction.customId; const command = client.commands.get(commandName); if (!command) return; diff --git a/src/client/funcs/listStations.js b/src/client/funcs/listStations.js index 5921b9e..94a5e94 100644 --- a/src/client/funcs/listStations.js +++ b/src/client/funcs/listStations.js @@ -1,4 +1,4 @@ -import { ActionRowBuilder, SelectMenuBuilder } from "discord.js"; +import { ActionRowBuilder, StringSelectMenuBuilder } from "discord.js"; module.exports = function listStations(client, interaction){ let stations = new Array(); @@ -16,7 +16,7 @@ module.exports = function listStations(client, interaction){ const menu = new ActionRowBuilder() .addComponents( - new SelectMenuBuilder() + new StringSelectMenuBuilder() .setCustomId('play') .setPlaceholder('Nothing selected') .addOptions(options)