From 3d5994cb8b68156b3c75acac27d7a5dfdf47e3bd Mon Sep 17 00:00:00 2001 From: SrIzan10 <66965250+SrIzan10@users.noreply.github.com> Date: Sat, 29 Oct 2022 23:37:55 +0200 Subject: [PATCH] fix: some unknown type errors --- commands/handlers/role-menu.ts | 1 + commands/moderation/warn.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/handlers/role-menu.ts b/commands/handlers/role-menu.ts index 7039691..5ec85f3 100644 --- a/commands/handlers/role-menu.ts +++ b/commands/handlers/role-menu.ts @@ -12,6 +12,7 @@ export default commandModule({ const menuRoles: string[] = ( interaction.message.components[0].components[0] .data as Readonly + // @ts-ignore ).options.map((o: { label: string; value: string }) => o.value); const member = interaction.member as GuildMember; diff --git a/commands/moderation/warn.ts b/commands/moderation/warn.ts index 299a827..88924c3 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, ButtonStyle, EmbedBuilder, GuildMember } from "discord.js"; +import { ActionRowBuilder, ApplicationCommandOptionType, ButtonBuilder, ButtonInteraction, ButtonStyle, EmbedBuilder, GuildMember } from "discord.js"; import db from '../../schemas/warn.js'; export default commandModule({ @@ -116,7 +116,7 @@ export default commandModule({ 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 }); - collector.on('collect', async i => { + collector.on('collect', async (i: ButtonInteraction) => { await i.deferReply({ephemeral: true}) if (i.customId === '1hour') { await i.editReply({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`}) @@ -170,7 +170,7 @@ export default commandModule({ 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 }); - collector.on('collect', async i => { + collector.on('collect', async (i: ButtonInteraction) => { if (i.customId === '1hour') { await i.channel!.send({content: `Se ha silenciado a ${usermember} durante 1 hora correctamente. ;-;`}) usermember.timeout(60 * 60 * 1000, reason)