因此,我用于让bot问候新用户的代码停止工作,我不知道为什么或如何使用这是im用于欢迎活动本身的代码```module.exports=(client)=>{const channelId='757493821251649608'//welcome channel const targetChannelId='757521186929246219'//rules and info
client.on('guildMemberAdd', (member) => {
const message = `Hi, hope you enjoy your stay <@${
member.id
}> , Oh i almost forgot to tell you, check out! ${member.guild.channels.cache
.get(targetChannelId)
.toString()}`
const channel = member.guild.channels.cache.get(channelId)
channel.send(message)
})
}```
这就是我让机器人执行它的方式
const hi = require('./events/hi')
const hello = require('./events/hello')
const yo = require('./events/yo')
const whatsup = require('./events/whatsUp')
const bye = require('./events/bye')
client.once('ready', () =>{
console.log('Aiko is working!');
client.user.setActivity(' your orders!|Prefix is +', { type: "LISTENING" });
hi(client)
hello(client)
yo(client)
whatsup(client)
bye(client)
welcome(client)
});```
The event that should also send a message when someone leaves the server also doesn't go off, anyone any idea why?
这很可能是一个特权意图问题,最近才需要这个问题。检查这个问题,看看它是否解决了它。还要阅读discord API文档以了解特权意图