我试图做一个欢迎信息,但它使我的机器人垃圾邮件的欢迎信息,出于某种原因,有人能帮助吗?
这是我的代码:
// Send the message to a designated channel on a server:
const channel = member.guild.channels.cache.find(ch => ch.name === 'yo');
// Do nothing if the channel wasn't found on this server
if (!channel) return;
const welcome = new Discord.MessageEmbed()
.setDescription(`***Welcome to Tracy*** ${member}***Boost Us!***`)
.setImage('https://media0.giphy.com/media/SwUpQs8oVWvZG5vpyS/giphy.gif')
.setColor(0x5933A0)
message.channel.send(welcome);
});这就是它给我的错误:
“检测到可能的EventEmitter内存泄漏。将11个guildMemberAdd侦听器添加到客户端。使用emitter.setMaxListeners()来增加限制”
我把emitter.setMaxListeners()放在哪里,还应该包括什么?
发布于 2020-06-17 17:13:48
很明显这不正常。
您的节点版本是什么?您有多个guildMemberAdd事件吗?
这可以帮助调试:NodeJS setMaxListeners
您可以尝试将其放入代码中:process.on('warning', e => console.warn(e.stack));
https://stackoverflow.com/questions/62432626
复制相似问题