#Collectors not working
9 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
const { EmbedBuilder } = require("discord.js");
module.exports = {
customId: `settings-menu`,
type: "select",
run: async (client, interaction) => {
const embed = new EmbedBuilder()
.setDescription(`Please mention your announcement channel, or enter its ID`)
.setColor("Blurple")
await interaction.reply({ embeds: [embed] })
let filter = m => m.author.id === interaction.user.id;
const collector = interaction.channel.createMessageCollector({ filter, time: 15000 });
collector.on('collect', async m => {
const channel = m?.mentions?.channels?.first() || m?.guild?.channels?.cache?.get(m?.content)
if (!channel?.id) {
return interaction.channel.send(`${interaction.user.tag}, It's not channel!`)
}
const get = await client.prisma.guild.findFirst({ where: { id: interaction.guild.id } })
await client.prisma.guild.upsert({
where: {
id: interaction.guild.id
},
create: {
id: interaction.guild.id,
broadcastChannel: channel.id
},
update: {
broadcastChannel: channel.id
}
})
const embedSuccessfully = new EmbedBuilder()
.setDescription(`Successfully added broadcast channel to database!\nNew value: ${channel.name} (<#${channel.id}>)\nYou have a few seconds to change your channel. `)
.setColor("Green")
await interaction.editReply({ embeds: [embedSuccessfully] });
});
collector.on('end', async collected => {
await interaction.editReply( { content: "Your time to complete the options is over.", embeds: [] })
collector.stop()
});
}
}
(No error in console)
show your intents
wait
ok im stupid, i forgot about it
sorry
thanks for reminder