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

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

      • <bdo id='WgkU8'></bdo><ul id='WgkU8'></ul>
      <legend id='WgkU8'><style id='WgkU8'><dir id='WgkU8'><q id='WgkU8'></q></dir></style></legend>
      1. 如何在 discord.py rewrite 中获取成员数?

        时间:2023-10-11

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

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

                  <bdo id='IWeav'></bdo><ul id='IWeav'></ul>
                  本文介绍了如何在 discord.py rewrite 中获取成员数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想发出一个命令来显示成员数,但它不起作用.

                  I wanted to make an command to show the membercount but it doesn't work.

                  这就是我所拥有的:

                  @bot.command(name='membercount')
                  async def membercount(ctx):
                      await ctx.send(len(guild.member_count))
                  

                  这是我得到的错误:模块discord.guild"没有member_count"成员

                  我尝试在互联网上搜索,但没有找到可行的选项.

                  I tried searching on the internet but didn't find a working option.

                  推荐答案

                  虽然 Ron 的示例 确实 工作,但考虑到 ctx.guild.members 只是一个列表,这意味着您可以在其上使用 len() :

                  Although Ron's example does work, it is not a very elegant way considering that ctx.guild.members is just a list, meaning you can use len() on it as such:

                  member_count = len(ctx.guild.members) # includes bots
                  
                  true_member_count = len([m for m in ctx.guild.members if not m.bot]) # doesn't include bots
                  

                  另外不要忘记,如果某个答案解决了您的问题,您应该将其标记为已接受",并在其旁边使用复选标记,以向来自搜索机器的其他用户显示该问题对您有用.

                  Also don't forget that if an answer solved your problem, you should mark it as "accepted" with that checkmark next to it, as to show other users coming from search machines to this question, what worked for you.

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

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

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

                        <bdo id='D30Cj'></bdo><ul id='D30Cj'></ul>