From a9ff00394a73f68a6793c2b35ff184675ee5a72c Mon Sep 17 00:00:00 2001 From: GramingFoxTeam Date: Tue, 21 Mar 2023 18:09:05 +0300 Subject: [PATCH] fix: fix the fiter for the interaction collector --- bots/discord/commands/trainMessage.js | 7 ++++--- bots/discord/events/helper/aiResponse.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bots/discord/commands/trainMessage.js b/bots/discord/commands/trainMessage.js index 1722517..a4960d5 100644 --- a/bots/discord/commands/trainMessage.js +++ b/bots/discord/commands/trainMessage.js @@ -2,6 +2,7 @@ import { ContextMenuCommandBuilder, ApplicationCommandType } from 'discord.js'; +import trainAISelectMenu from '../utils/trainAISelectMenu.js'; export default { data: new ContextMenuCommandBuilder() @@ -12,11 +13,11 @@ export default { interaction.member.roles.highest.comparePositionTo( interaction.member.guild.roles.cache.get(config.discord.trainRole) ) < 0 - ) - return interaction.reply({ + ) return interaction.reply({ content: 'You don\'t have the permission to do this.', ephemeral: true }); - + + trainAISelectMenu(interaction, config, helper); } }; diff --git a/bots/discord/events/helper/aiResponse.js b/bots/discord/events/helper/aiResponse.js index c51ec1f..de55e0d 100644 --- a/bots/discord/events/helper/aiResponse.js +++ b/bots/discord/events/helper/aiResponse.js @@ -55,7 +55,7 @@ export default { const reply = await message.reply({ embeds: [embed], components: [feedbackRow] }); const filter = (i) => i.member.roles.highest.comparePositionTo( i.member.guild.roles.cache.get(config.discord.trainRole) - ) < 0 + ) > 0 const collector = reply.createMessageComponentCollector({ filter, time: 15_000 }); collector.on('collect', (i) => {