From d538054b077707edf4bd5fe2aadf585cde571971 Mon Sep 17 00:00:00 2001 From: SrIzan10 <66965250+SrIzan10@users.noreply.github.com> Date: Mon, 31 Oct 2022 20:08:40 +0100 Subject: [PATCH] fix: warn command? --- commands/moderation/warn.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/moderation/warn.ts b/commands/moderation/warn.ts index 4c1303d..79bf1c8 100644 --- a/commands/moderation/warn.ts +++ b/commands/moderation/warn.ts @@ -1,7 +1,7 @@ import { commandModule, CommandType } from '@sern/handler' import { publish } from "../../src/plugins/publish.js"; import { ownerOnly } from "../../src/plugins/ownerOnly.js"; -import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonInteraction, ButtonStyle, EmbedBuilder, GuildMember } from "discord.js"; +import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonInteraction, ButtonStyle, ComponentType, EmbedBuilder, GuildMember } from "discord.js"; import db from '../../schemas/warn.js'; export default commandModule({ @@ -115,7 +115,7 @@ export default commandModule({ } else { if (times.times > 2) { const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, ephemeral: true, components: [buttons]}) - const collector = msg.createMessageComponentCollector({ time: 15000, max: 1 }); + const collector = msg.createMessageComponentCollector({ time: 15000, max: 1, componentType: ComponentType.Button }); collector.on('collect', async (i) => { await i.deferReply({ephemeral: true}) if (i.customId === '1hour') { @@ -169,7 +169,7 @@ export default commandModule({ } else { if (times.times >= 4) { const msg = await ctx.reply({content: `El usuario ha excedido 3 avisos, ¿qué hacer?`, ephemeral: true, components: [buttons]}) - const collector = await msg.createMessageComponentCollector({ time: 1000, max: 1 }); + const collector = msg.createMessageComponentCollector({ time: 1000, max: 1, componentType: ComponentType.Button }); collector.on('collect', async (i) => { if (i.customId === '1hour') { await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`})