Guild members are not populated anymore, cannot GetUserAsync as it only returns the bot and no one else

后端 未结 1 573
梦毁少年i
梦毁少年i 2020-12-11 13:48

For some reason I cannot get any members anymore from the guild the bot is in.

To make sure I have the users, I construct it with

        DiscordSocket         


        
相关标签:
1条回答
  • 2020-12-11 14:05

    This is a result of Discord enforcing intents.

    Intents allow you to opt-in to certain gateway events. Currently, the GUILD_MEMBERS and GUILD_PRESENCES intents are "privileged intents" and have the following effects:

    • GUILD_MEMBER_[ADD|UPDATE|REMOVE] requires the GUILD_MEMBERS intent to be received
    • PRESENCE_UPDATE requires the GUILD_PRESENCES intent to be received
    • REQUEST_GUILD_MEMBERS
      • requires GUILD_PRESENCES intent to set presences=true
      • requires GUILD_MEMBERS intent to request the whole list (query='', limit=0<=n)
      • is limited to requesting 1 guild_id
      • is limited to 100 members when using a prefix (query='prefix', limit=1<=n<=100)
    • GUILD_CREATE requires GUILD_PRESENCES intent to contain more than just the bot and voice members
    • List Guild Members requires GUILD_MEMBERS intent to access

    Privileged intents are disabled by default. To enable them:

    • Visit https://discord.com/developers/applications
    • Click on the bot where you wish to enable privileged intents
    • Navigate to the "Bot" tab on the left
    • Scroll to the Privileged Gateway Intents section
    • Enable your desired intents

    If your bot is in over 100 guilds, you will need to verify your bot: https://dis.gd/bot-verification. If your bot is already verified, but need to request intents permission, contact Discord support: https://dis.gd/contact.

    0 讨论(0)
提交回复
热议问题