mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-05 04:13:08 +02:00
SelectMenu -> StringSelectMenu
This commit is contained in:
parent
5c2eed2d7b
commit
a10a1663a3
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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),
|
||||
),
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user