mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix: fix the fiter for the interaction collector
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user