【问题标题】:Discord bot stopped sending welcome messagesDiscord 机器人停止发送欢迎消息
【发布时间】:2021-02-22 07:12:29
【问题描述】:

所以,我让机器人迎接新用户的代码停止工作,我不知道为什么或如何 这是我用于欢迎事件本身的代码 ```module.exports = (client) => { const channelId = '757493821251649608' // 欢迎频道 const targetChannelId = '757521186929246219' // 规则和信息

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?

【问题讨论】:

标签: node.js discord.js


【解决方案1】:

这很可能是最近才需要的特权意图问题。查看this 问题,看看它是否解决了问题。另请阅读 privileged intents 的不和谐 API 文档

【讨论】:

    猜你喜欢
    • 2022-01-23
    • 1970-01-01
    • 2020-01-22
    • 2020-05-18
    • 2021-08-19
    • 1970-01-01
    • 2021-06-14
    • 1970-01-01
    • 2021-01-08
    相关资源
    最近更新 更多