message collector not working?

Hello my bot has a message collector and it has been working for the longest time untill I swapped to djs14 I didn’t touch the code for the collector but turns out it no longer works? The channel is the correct channel and when the collector expires the on end gets executed but there is no on collect that gets executed when the user types anything, even without a filter no messages are collected. Any clues?
8 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Harnes
Harnes12mo ago
You should read guide about updating your code to v14
d.js docs
d.js docs12mo ago
guide Additional Information: Updating from v13 to v14 read more
Vigintillion
VigintillionOP12mo ago
Cant find anything about message collector though
Harnes
Harnes12mo ago
First of all show your code
Vigintillion
VigintillionOP12mo ago
Am on phone rn so sorry for bad formatting const collector = cmd.channel.createMessageCollector({ filter: (msg) => msg.author.id === cmd.member.id, idle: 30*1000 }); collector.on((collected) => console.log(collected)); cmd.channel is a valid channel And it is infeed the channel that it’s supposed to collect in
treble/luna
treble/luna12mo ago
do you have the required intents namely Guilds and GuildMessages
Vigintillion
VigintillionOP12mo ago
Yes Bot is also approved for the message intent Yeah I was on phone sec Here you go:
private getInvite(channel: TextChannel, userId: string) {
const collector = channel.createMessageCollector({
filter: (msg) => msg.author.id === userId,
idle: 30*1000
});
collector.on("collect", async (message) => {
console.log(message)
message.delete();
collector.stop();
....
});
}
private getInvite(channel: TextChannel, userId: string) {
const collector = channel.createMessageCollector({
filter: (msg) => msg.author.id === userId,
idle: 30*1000
});
collector.on("collect", async (message) => {
console.log(message)
message.delete();
collector.stop();
....
});
}
yeah I'm still passing strings as intents thats prob the issue Yup that was the issue weird ts doesnt give error for that

Did you find this page helpful?