mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
SelectMenu -> StringSelectMenu
This commit is contained in:
parent
5c2eed2d7b
commit
a10a1663a3
@ -7,8 +7,8 @@ const {
|
|||||||
ButtonStyle,
|
ButtonStyle,
|
||||||
inlineCode,
|
inlineCode,
|
||||||
ModalBuilder,
|
ModalBuilder,
|
||||||
SelectMenuBuilder,
|
StringSelectMenuBuilder,
|
||||||
SelectMenuOptionBuilder,
|
StringSelectMenuOptionBuilder,
|
||||||
TextInputBuilder,
|
TextInputBuilder,
|
||||||
TextInputStyle,
|
TextInputStyle,
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
@ -16,8 +16,9 @@ const emoji = require('node-emoji');
|
|||||||
const ms = require('ms');
|
const ms = require('ms');
|
||||||
const ExtendedEmbedBuilder = require('../embed');
|
const ExtendedEmbedBuilder = require('../embed');
|
||||||
const { logTicketEvent } = require('../logging');
|
const { logTicketEvent } = require('../logging');
|
||||||
|
const { Collection } = require('discord.js');
|
||||||
const Cryptr = require('cryptr');
|
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 &
|
* @typedef {import('@prisma/client').Category &
|
||||||
@ -241,14 +242,14 @@ module.exports = class TicketManager {
|
|||||||
} else if (q.type === 'MENU') {
|
} else if (q.type === 'MENU') {
|
||||||
return new ActionRowBuilder()
|
return new ActionRowBuilder()
|
||||||
.setComponents(
|
.setComponents(
|
||||||
new SelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId(q.id)
|
.setCustomId(q.id)
|
||||||
.setPlaceholder(q.placeholder || q.label)
|
.setPlaceholder(q.placeholder || q.label)
|
||||||
.setMaxValues(q.maxLength)
|
.setMaxValues(q.maxLength)
|
||||||
.setMinValues(q.minLength)
|
.setMinValues(q.minLength)
|
||||||
.setOptions(
|
.setOptions(
|
||||||
q.options.map((o, i) => {
|
q.options.map((o, i) => {
|
||||||
const builder = new SelectMenuOptionBuilder()
|
const builder = new StringSelectMenuOptionBuilder()
|
||||||
.setValue(String(i))
|
.setValue(String(i))
|
||||||
.setLabel(o.label);
|
.setLabel(o.label);
|
||||||
if (o.description) builder.setDescription(o.description);
|
if (o.description) builder.setDescription(o.description);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
const {
|
const {
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
SelectMenuBuilder,
|
StringSelectMenuBuilder,
|
||||||
SelectMenuOptionBuilder,
|
StringSelectMenuOptionBuilder,
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
const emoji = require('node-emoji');
|
const emoji = require('node-emoji');
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ module.exports = {
|
|||||||
components: [
|
components: [
|
||||||
new ActionRowBuilder()
|
new ActionRowBuilder()
|
||||||
.setComponents(
|
.setComponents(
|
||||||
new SelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId(JSON.stringify({
|
.setCustomId(JSON.stringify({
|
||||||
action: 'create',
|
action: 'create',
|
||||||
referencesMessage,
|
referencesMessage,
|
||||||
@ -60,7 +60,7 @@ module.exports = {
|
|||||||
.setPlaceholder(getMessage('menus.category.placeholder'))
|
.setPlaceholder(getMessage('menus.category.placeholder'))
|
||||||
.setOptions(
|
.setOptions(
|
||||||
settings.categories.map(category =>
|
settings.categories.map(category =>
|
||||||
new SelectMenuOptionBuilder()
|
new StringSelectMenuOptionBuilder()
|
||||||
.setValue(String(category.id))
|
.setValue(String(category.id))
|
||||||
.setLabel(category.name)
|
.setLabel(category.name)
|
||||||
.setDescription(category.description)
|
.setDescription(category.description)
|
||||||
|
@ -6,8 +6,8 @@ const {
|
|||||||
ChannelType,
|
ChannelType,
|
||||||
ComponentType,
|
ComponentType,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
SelectMenuBuilder,
|
StringSelectMenuBuilder,
|
||||||
SelectMenuOptionBuilder,
|
StringSelectMenuOptionBuilder,
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
const {
|
const {
|
||||||
getCommonGuilds,
|
getCommonGuilds,
|
||||||
@ -52,7 +52,7 @@ module.exports = class extends Listener {
|
|||||||
components: [
|
components: [
|
||||||
new ActionRowBuilder()
|
new ActionRowBuilder()
|
||||||
.setComponents(
|
.setComponents(
|
||||||
new SelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId(JSON.stringify({
|
.setCustomId(JSON.stringify({
|
||||||
action: 'create',
|
action: 'create',
|
||||||
topic,
|
topic,
|
||||||
@ -60,7 +60,7 @@ module.exports = class extends Listener {
|
|||||||
.setPlaceholder(getMessage('menus.category.placeholder'))
|
.setPlaceholder(getMessage('menus.category.placeholder'))
|
||||||
.setOptions(
|
.setOptions(
|
||||||
settings.categories.map(category =>
|
settings.categories.map(category =>
|
||||||
new SelectMenuOptionBuilder()
|
new StringSelectMenuOptionBuilder()
|
||||||
.setValue(String(category.id))
|
.setValue(String(category.id))
|
||||||
.setLabel(category.name)
|
.setLabel(category.name)
|
||||||
.setDescription(category.description)
|
.setDescription(category.description)
|
||||||
@ -143,12 +143,12 @@ module.exports = class extends Listener {
|
|||||||
components: [
|
components: [
|
||||||
new ActionRowBuilder()
|
new ActionRowBuilder()
|
||||||
.setComponents(
|
.setComponents(
|
||||||
new SelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId(message.id)
|
.setCustomId(message.id)
|
||||||
.setPlaceholder(getMessage('menus.guild.placeholder'))
|
.setPlaceholder(getMessage('menus.guild.placeholder'))
|
||||||
.setOptions(
|
.setOptions(
|
||||||
commonGuilds.map(g =>
|
commonGuilds.map(g =>
|
||||||
new SelectMenuOptionBuilder()
|
new StringSelectMenuOptionBuilder()
|
||||||
.setValue(String(g.id))
|
.setValue(String(g.id))
|
||||||
.setLabel(g.name),
|
.setLabel(g.name),
|
||||||
),
|
),
|
||||||
|
@ -7,8 +7,8 @@ const {
|
|||||||
},
|
},
|
||||||
ChannelType: { GuildText },
|
ChannelType: { GuildText },
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
SelectMenuBuilder,
|
StringSelectMenuBuilder,
|
||||||
SelectMenuOptionBuilder,
|
StringSelectMenuOptionBuilder,
|
||||||
} = require('discord.js');
|
} = require('discord.js');
|
||||||
const emoji = require('node-emoji');
|
const emoji = require('node-emoji');
|
||||||
const { logAdminEvent } = require('../../../../../lib/logging');
|
const { logAdminEvent } = require('../../../../../lib/logging');
|
||||||
@ -102,12 +102,12 @@ module.exports.post = fastify => ({
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
components.push(
|
components.push(
|
||||||
new SelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId(JSON.stringify({ action: 'create' }))
|
.setCustomId(JSON.stringify({ action: 'create' }))
|
||||||
.setPlaceholder(getMessage('menus.category.placeholder'))
|
.setPlaceholder(getMessage('menus.category.placeholder'))
|
||||||
.setOptions(
|
.setOptions(
|
||||||
categories.map(category =>
|
categories.map(category =>
|
||||||
new SelectMenuOptionBuilder()
|
new StringSelectMenuOptionBuilder()
|
||||||
.setValue(String(category.id))
|
.setValue(String(category.id))
|
||||||
.setLabel(category.name)
|
.setLabel(category.name)
|
||||||
.setDescription(category.description)
|
.setDescription(category.description)
|
||||||
|
Loading…
Reference in New Issue
Block a user