Open Alex-Toucan opened 2 years ago
I'm pretty sure this is because you added 50 message event listeners. I would recommend doing something like
const list = [apple, orange]
on message ->
if (!list.includes(message.param[0]) return
else
message.reply("unsplash.com/${message.param[0]}"
obviously this is pesudo code. Also saves you a few hundred loc and makes the program easier to maintain. In your case you might instead want an object
{
"apple": "🍎"
}
to also lookup the relevent emoji. You can then call Object.entries and implement otherwise the same pesudo code above
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Detected in index.js, no trace.