【问题标题】:Discord bot on_member_join Is not working Can someone explaintDiscord bot on_member_join 不起作用 有人可以解释一下吗
【发布时间】:2021-07-15 05:40:30
【问题描述】:

【问题讨论】:

  • 您的代码没有member 参数。它实际上什么都不做。

标签: python discord.py


【解决方案1】:

discord.on_member_join 函数将"member" 作为参数。然后您可以使用member.send("Your message here") 向您的用户发送收件箱。

官方文档here.

【讨论】:

  • 我要替换什么?
  • discord.on_member_join 中唯一的参数是“member”。因此,您不能将“消息”传递给该函数。
【解决方案2】:

首先将(消息)更改为(成员)。然后;

  1. 转到 Discord 开发者门户并;
  • 转到您的机器人所在的应用程序。
  • 打开服务器成员意图。
  1. 在导入后将此添加到您的代码中;
#imports here

intents = discord.Intents.default()
intents.members = True

那么它应该可以工作。 这也是Discord.py on_member_join not working, no error message 的副本。

【讨论】:

    猜你喜欢
    • 2021-07-03
    • 1970-01-01
    • 1970-01-01
    • 2011-11-22
    • 2016-12-12
    • 2020-06-14
    • 2021-01-28
    • 2011-03-02
    • 1970-01-01
    相关资源
    最近更新 更多