I have a command where it asks a question and gives different responses based on the answer, and that part works, but the command doest end, meaning that if you reply to a new instance of the command, the first instance and the new instance will reply. I tried different timeout functions but nothing worked. here's the code:
module.exports = {
name: 'test',
description: "test comand",
execute(message, args, Discord) {
message.channel.send("Do you want to test this command?\n `Yes`, `No` or `Mayhaps`")
console.log(message.author.id)
const collector = new Discord.MessageCollector(message.channel, m => m.author.id === member, { time: 10000 });
collector.on('collect', message => {
if (message.content.toUpperCase() == "YES") {
message.channel.send("Let's Go! It worked!");
} else if (message.content.toUpperCase() == "NO") {
message.channel.send( "Task failed successfully.");
} else if (message.content.toUpperCase() == "MAYHAPS") {
message.channel.send("ERROR: IT WORKED ANYWAY");
}
})
}
}