Answer the question
In order to leave comments, you need to log in
How to stop discord.js message listener in node server?
How can I force the application to stop "listening" to user's discord messages under certain conditions?
To avoid misunderstandings, below is the listener initialization code
var Discord = require('discord.js');
const client = new Discord.Client();
client.on('message', async message =>{ //Тот самый злосчастный listener
//Некоторый код
}
Answer the question
In order to leave comments, you need to log in
if Discord.Client inherits from EventEmitter then
const handler = async message => {
// ...
};
client.on('message', handler);
client.removeEventListener('message', handler);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question