I am making a discord bot and I want to end an open message collector
Here is the code I have
const collector = new discord.MessageCollector(message.channel, m => m.author.id === message.author.id)
collector.on('collect', msg => {
// here is where I want it to close
msg.reply("You win!")
})
To stop a message collector from collecting messages simply use MessageCollector.stop()
Your code will look something like this :
const collector = new discord.MessageCollector(message.channel, m => m.author.id === message.author.id)
collector.on('collect', msg => {
collector.stop()
msg.reply("You win!")
})
This is something really simple to find, I just googled it and found it easily