• <tfoot id='UMjv5'></tfoot>

          <bdo id='UMjv5'></bdo><ul id='UMjv5'></ul>
      1. <legend id='UMjv5'><style id='UMjv5'><dir id='UMjv5'><q id='UMjv5'></q></dir></style></legend>

        <i id='UMjv5'><tr id='UMjv5'><dt id='UMjv5'><q id='UMjv5'><span id='UMjv5'><b id='UMjv5'><form id='UMjv5'><ins id='UMjv5'></ins><ul id='UMjv5'></ul><sub id='UMjv5'></sub></form><legend id='UMjv5'></legend><bdo id='UMjv5'><pre id='UMjv5'><center id='UMjv5'></center></pre></bdo></b><th id='UMjv5'></th></span></q></dt></tr></i><div id='UMjv5'><tfoot id='UMjv5'></tfoot><dl id='UMjv5'><fieldset id='UMjv5'></fieldset></dl></div>

        <small id='UMjv5'></small><noframes id='UMjv5'>

      2. 获取所有成员 discord.py

        时间:2023-09-09

        <tfoot id='dFETL'></tfoot>
        1. <small id='dFETL'></small><noframes id='dFETL'>

              <bdo id='dFETL'></bdo><ul id='dFETL'></ul>
              <i id='dFETL'><tr id='dFETL'><dt id='dFETL'><q id='dFETL'><span id='dFETL'><b id='dFETL'><form id='dFETL'><ins id='dFETL'></ins><ul id='dFETL'></ul><sub id='dFETL'></sub></form><legend id='dFETL'></legend><bdo id='dFETL'><pre id='dFETL'><center id='dFETL'></center></pre></bdo></b><th id='dFETL'></th></span></q></dt></tr></i><div id='dFETL'><tfoot id='dFETL'></tfoot><dl id='dFETL'><fieldset id='dFETL'></fieldset></dl></div>

              1. <legend id='dFETL'><style id='dFETL'><dir id='dFETL'><q id='dFETL'></q></dir></style></legend>
                    <tbody id='dFETL'></tbody>
                  本文介绍了获取所有成员 discord.py的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个问题,我需要从机器人在线的所有服务器的所有成员那里获取一个列表(我正在使用 discord.py 重写),现在我已经截断了这段代码:

                  I've got a question, I need to get a list from all members from all servers where the bot is online(I'm using discord.py rewrite), Right now I have this code-snipped:

                  @bot.command()
                  async def members(ctx):
                      for guild in bot.guilds:
                          for member in guild.members:
                              print(member)
                  

                  程序输出 Bots 名称 3 次,因为 bot 在 3 个服务器上.

                  The program outputs the Bots name 3 times because the bot is on 3 servers.

                  谢谢!

                  推荐答案

                  听起来像是 Intents 问题.您需要在创建 commands.Bot 实例时启用 members Intent,并将您的 Intent 传递给它.

                  Sounds like an Intents issue. You need to enable the members intent when creating your commands.Bot instance, and pass your intents into it.

                  intents = discord.Intents.default()
                  intents.members = True
                  
                  client = commands.Bot(intents=intents, prefix_and_other_things_go_here)
                  

                  您还必须在您的开发者门户中启用它.有关如何 & 的更多信息其中:https://discordpy.readthedocs.io/en/latest/intents.html

                  You also have to enable it in your developer portal. More info on how & where: https://discordpy.readthedocs.io/en/latest/intents.html

                  这篇关于获取所有成员 discord.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Discord.py 缺少必需的参数 下一篇:如何检查用户是否在不和谐中具有特定角色

                  相关文章

                  最新文章

                  <tfoot id='bvtq6'></tfoot>
                • <small id='bvtq6'></small><noframes id='bvtq6'>

                      <bdo id='bvtq6'></bdo><ul id='bvtq6'></ul>
                    <legend id='bvtq6'><style id='bvtq6'><dir id='bvtq6'><q id='bvtq6'></q></dir></style></legend>
                    <i id='bvtq6'><tr id='bvtq6'><dt id='bvtq6'><q id='bvtq6'><span id='bvtq6'><b id='bvtq6'><form id='bvtq6'><ins id='bvtq6'></ins><ul id='bvtq6'></ul><sub id='bvtq6'></sub></form><legend id='bvtq6'></legend><bdo id='bvtq6'><pre id='bvtq6'><center id='bvtq6'></center></pre></bdo></b><th id='bvtq6'></th></span></q></dt></tr></i><div id='bvtq6'><tfoot id='bvtq6'></tfoot><dl id='bvtq6'><fieldset id='bvtq6'></fieldset></dl></div>