From a10a1663a3545063a94a94467bab2146211fd151 Mon Sep 17 00:00:00 2001 From: Isaac Date: Mon, 2 Jan 2023 12:23:14 +0000 Subject: [PATCH] SelectMenu -> StringSelectMenu --- src/lib/tickets/manager.js | 11 ++++++----- src/lib/tickets/utils.js | 8 ++++---- src/listeners/client/messageCreate.js | 12 ++++++------ src/routes/api/admin/guilds/[guild]/panels.js | 8 ++++---- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/lib/tickets/manager.js b/src/lib/tickets/manager.js index 1cf33b1..bb926ac 100644 --- a/src/lib/tickets/manager.js +++ b/src/lib/tickets/manager.js @@ -7,8 +7,8 @@ const { ButtonStyle, inlineCode, ModalBuilder, - SelectMenuBuilder, - SelectMenuOptionBuilder, + StringSelectMenuBuilder, + StringSelectMenuOptionBuilder, TextInputBuilder, TextInputStyle, } = require('discord.js'); @@ -16,8 +16,9 @@ const emoji = require('node-emoji'); const ms = require('ms'); const ExtendedEmbedBuilder = require('../embed'); const { logTicketEvent } = require('../logging'); +const { Collection } = require('discord.js'); const Cryptr = require('cryptr'); -const cryptr = new Cryptr(process.env.ENCRYPTION_KEY); +const { encrypt } = new Cryptr(process.env.ENCRYPTION_KEY); /** * @typedef {import('@prisma/client').Category & @@ -241,14 +242,14 @@ module.exports = class TicketManager { } else if (q.type === 'MENU') { return new ActionRowBuilder() .setComponents( - new SelectMenuBuilder() + new StringSelectMenuBuilder() .setCustomId(q.id) .setPlaceholder(q.placeholder || q.label) .setMaxValues(q.maxLength) .setMinValues(q.minLength) .setOptions( q.options.map((o, i) => { - const builder = new SelectMenuOptionBuilder() + const builder = new StringSelectMenuOptionBuilder() .setValue(String(i)) .setLabel(o.label); if (o.description) builder.setDescription(o.description); diff --git a/src/lib/tickets/utils.js b/src/lib/tickets/utils.js index 9cae372..4949e05 100644 --- a/src/lib/tickets/utils.js +++ b/src/lib/tickets/utils.js @@ -1,8 +1,8 @@ const { ActionRowBuilder, EmbedBuilder, - SelectMenuBuilder, - SelectMenuOptionBuilder, + StringSelectMenuBuilder, + StringSelectMenuOptionBuilder, } = require('discord.js'); const emoji = require('node-emoji'); @@ -50,7 +50,7 @@ module.exports = { components: [ new ActionRowBuilder() .setComponents( - new SelectMenuBuilder() + new StringSelectMenuBuilder() .setCustomId(JSON.stringify({ action: 'create', referencesMessage, @@ -60,7 +60,7 @@ module.exports = { .setPlaceholder(getMessage('menus.category.placeholder')) .setOptions( settings.categories.map(category => - new SelectMenuOptionBuilder() + new StringSelectMenuOptionBuilder() .setValue(String(category.id)) .setLabel(category.name) .setDescription(category.description) diff --git a/src/listeners/client/messageCreate.js b/src/listeners/client/messageCreate.js index 56a07b6..1832b4e 100644 --- a/src/listeners/client/messageCreate.js +++ b/src/listeners/client/messageCreate.js @@ -6,8 +6,8 @@ const { ChannelType, ComponentType, EmbedBuilder, - SelectMenuBuilder, - SelectMenuOptionBuilder, + StringSelectMenuBuilder, + StringSelectMenuOptionBuilder, } = require('discord.js'); const { getCommonGuilds, @@ -52,7 +52,7 @@ module.exports = class extends Listener { components: [ new ActionRowBuilder() .setComponents( - new SelectMenuBuilder() + new StringSelectMenuBuilder() .setCustomId(JSON.stringify({ action: 'create', topic, @@ -60,7 +60,7 @@ module.exports = class extends Listener { .setPlaceholder(getMessage('menus.category.placeholder')) .setOptions( settings.categories.map(category => - new SelectMenuOptionBuilder() + new StringSelectMenuOptionBuilder() .setValue(String(category.id)) .setLabel(category.name) .setDescription(category.description) @@ -143,12 +143,12 @@ module.exports = class extends Listener { components: [ new ActionRowBuilder() .setComponents( - new SelectMenuBuilder() + new StringSelectMenuBuilder() .setCustomId(message.id) .setPlaceholder(getMessage('menus.guild.placeholder')) .setOptions( commonGuilds.map(g => - new SelectMenuOptionBuilder() + new StringSelectMenuOptionBuilder() .setValue(String(g.id)) .setLabel(g.name), ), diff --git a/src/routes/api/admin/guilds/[guild]/panels.js b/src/routes/api/admin/guilds/[guild]/panels.js index e60c02b..7181b1b 100644 --- a/src/routes/api/admin/guilds/[guild]/panels.js +++ b/src/routes/api/admin/guilds/[guild]/panels.js @@ -7,8 +7,8 @@ const { }, ChannelType: { GuildText }, EmbedBuilder, - SelectMenuBuilder, - SelectMenuOptionBuilder, + StringSelectMenuBuilder, + StringSelectMenuOptionBuilder, } = require('discord.js'); const emoji = require('node-emoji'); const { logAdminEvent } = require('../../../../../lib/logging'); @@ -102,12 +102,12 @@ module.exports.post = fastify => ({ ); } else { components.push( - new SelectMenuBuilder() + new StringSelectMenuBuilder() .setCustomId(JSON.stringify({ action: 'create' })) .setPlaceholder(getMessage('menus.category.placeholder')) .setOptions( categories.map(category => - new SelectMenuOptionBuilder() + new StringSelectMenuOptionBuilder() .setValue(String(category.id)) .setLabel(category.name) .setDescription(category.description)