diff --git a/commands/handlers/mcform.ts b/commands/handlers/mcform.ts index 7cccd04..a76f6e1 100644 --- a/commands/handlers/mcform.ts +++ b/commands/handlers/mcform.ts @@ -9,6 +9,7 @@ import { } from 'discord.js'; export default commandModule({ + name: 'mcform-main', type: CommandType.Modal, plugins: [], description: 'Envia el formulario para entrar al servidor.', diff --git a/commands/minecraft/mcform.ts b/commands/minecraft/mcform.ts index 3532844..54ab155 100644 --- a/commands/minecraft/mcform.ts +++ b/commands/minecraft/mcform.ts @@ -1,32 +1,33 @@ -import { commandModule, CommandType } from '@sern/handler' -import { ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ModalActionRowComponentBuilder } from 'discord.js' -import { publish } from "#plugins"; -import { ownerOnly } from "#plugins"; - +import { commandModule, CommandType } from '@sern/handler'; +import { + ActionRowBuilder, + ModalBuilder, + TextInputBuilder, + TextInputStyle, + ModalActionRowComponentBuilder, +} from 'discord.js'; +import { publish } from '#plugins'; +import { ownerOnly } from '#plugins'; export default commandModule({ name: 'mcform', - type: CommandType.Slash, + type: CommandType.Slash, plugins: [publish()], description: 'Envia el formulario para entrar al servidor.', //alias : [], execute: async (ctx) => { const modal = new ModalBuilder() - .setCustomId('mcform') - .setTitle('Formulario para entrar al servidor'); - // Create the text input components - const input = new TextInputBuilder() - .setCustomId('mcUsernameInput') - // The label is the prompt the user sees for this input - .setLabel("Cuál es tu nombre de usuario de Minecraft?") - // Short means only a single line of text - .setStyle(TextInputStyle.Short); - // An action row only holds one text input, - // so you need one action row per text input. - const usernameActionRow = new ActionRowBuilder().addComponents(input); - - // Add inputs to the modal - modal.addComponents(usernameActionRow); - await ctx.interaction.showModal(modal); - } -}); \ No newline at end of file + .setCustomId('mcform-main') + .setTitle('Formulario para entrar al servidor'); + const input = new TextInputBuilder() + .setCustomId('mcUsernameInput') + .setLabel('Cuál es tu nombre de usuario de Minecraft?') + .setStyle(TextInputStyle.Short); + const usernameActionRow = + new ActionRowBuilder().addComponents( + input + ); + modal.addComponents(usernameActionRow); + await ctx.interaction.showModal(modal); + }, +}); diff --git a/index.ts b/index.ts index 3f22210..61a6e24 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,4 @@ -import { DefaultLogging, Dependencies, single, Singleton } from '@sern/handler'; +import { DefaultLogging, Dependencies, ModuleManager, single, Singleton } from '@sern/handler'; import { ActivityType } from 'discord.js'; import { Client, GatewayIntentBits } from 'discord.js'; import { Sern } from '@sern/handler'; diff --git a/package-lock.json b/package-lock.json index 195dcbc..7fccf26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.14.0", "@napi-rs/canvas": "^0.1.30", - "@sern/handler": "^2.0.0", + "@sern/handler": "^2.1.1", "axios": "^1.1.3", "country-flag-emoji": "^1.0.3", "dayjs": "^1.11.6", @@ -493,9 +493,9 @@ } }, "node_modules/@sern/handler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sern/handler/-/handler-2.0.0.tgz", - "integrity": "sha512-i9BbUxwOYX1rn1FUfVFT+c8ltAloEfIMUznOt2T4h1xbWyXm/aKocmcgt5DkBHRU8yGoCfDiFF3E3I1mHln3UQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@sern/handler/-/handler-2.1.1.tgz", + "integrity": "sha512-yPWOgUvi+9et6fC2BxLyIes5zvOLgorXdpLmI84cN7K7NVpYA/kRj2Y0aqriYb2fOdlPeakptODJwabwDSBfZw==", "dependencies": { "iti": "^0.5.0", "rxjs": "^7.5.6", @@ -1260,9 +1260,9 @@ } }, "node_modules/discord.js/node_modules/discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.25", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.25.tgz", + "integrity": "sha512-aCwA2sWnL1zPQgTELkkMzQneuWyCXXUjZCUKswesiE6RDCfOfxAPXOHg6ZTlBA5layPSikGCBBRjyh8S3Wzd+A==" }, "node_modules/dom-serializer": { "version": "2.0.0", @@ -3694,9 +3694,9 @@ "integrity": "sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw==" }, "@sern/handler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sern/handler/-/handler-2.0.0.tgz", - "integrity": "sha512-i9BbUxwOYX1rn1FUfVFT+c8ltAloEfIMUznOt2T4h1xbWyXm/aKocmcgt5DkBHRU8yGoCfDiFF3E3I1mHln3UQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@sern/handler/-/handler-2.1.1.tgz", + "integrity": "sha512-yPWOgUvi+9et6fC2BxLyIes5zvOLgorXdpLmI84cN7K7NVpYA/kRj2Y0aqriYb2fOdlPeakptODJwabwDSBfZw==", "requires": { "iti": "^0.5.0", "rxjs": "^7.5.6", @@ -4253,9 +4253,9 @@ }, "dependencies": { "discord-api-types": { - "version": "0.37.24", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.24.tgz", - "integrity": "sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==" + "version": "0.37.25", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.25.tgz", + "integrity": "sha512-aCwA2sWnL1zPQgTELkkMzQneuWyCXXUjZCUKswesiE6RDCfOfxAPXOHg6ZTlBA5layPSikGCBBRjyh8S3Wzd+A==" } } }, diff --git a/package.json b/package.json index 7207a61..87adc9e 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.14.0", "@napi-rs/canvas": "^0.1.30", - "@sern/handler": "^2.0.0", + "@sern/handler": "^2.1.1", "axios": "^1.1.3", "country-flag-emoji": "^1.0.3", "dayjs": "^1.11.6",