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

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

    <tfoot id='CQyX1'></tfoot>
      <bdo id='CQyX1'></bdo><ul id='CQyX1'></ul>
    1. (discord.py) 获取特定语音频道中所有成员的列表

      时间:2023-09-09
    2. <i id='o0oOZ'><tr id='o0oOZ'><dt id='o0oOZ'><q id='o0oOZ'><span id='o0oOZ'><b id='o0oOZ'><form id='o0oOZ'><ins id='o0oOZ'></ins><ul id='o0oOZ'></ul><sub id='o0oOZ'></sub></form><legend id='o0oOZ'></legend><bdo id='o0oOZ'><pre id='o0oOZ'><center id='o0oOZ'></center></pre></bdo></b><th id='o0oOZ'></th></span></q></dt></tr></i><div id='o0oOZ'><tfoot id='o0oOZ'></tfoot><dl id='o0oOZ'><fieldset id='o0oOZ'></fieldset></dl></div>

          <tfoot id='o0oOZ'></tfoot>

          <legend id='o0oOZ'><style id='o0oOZ'><dir id='o0oOZ'><q id='o0oOZ'></q></dir></style></legend>
            <tbody id='o0oOZ'></tbody>

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

              <bdo id='o0oOZ'></bdo><ul id='o0oOZ'></ul>
              1. 本文介绍了(discord.py) 获取特定语音频道中所有成员的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                所以我正在尝试使用 python 中的 discord.py 库为我的突袭不和谐编写一个突袭机器人.该脚本应该在语音频道中形成一个成员列表以进行袭击.由于某种原因,此脚本无法正常工作.每当打印 memids 时,它只会打印一个空列表.

                So I'm attempting to write a raiding bot for my raiding discord using the discord.py library in python. This scripts is supposed to be forming a list of members in the voice channel for raiding. For some reason, this script is not working. Whenever memids is printed, it just prints an empty list.

                如果有人熟悉 discord.py 并且可以告诉我为什么这不起作用,请这样做.这真的让我很困扰,我已经尽我所能来解决它​​.

                If anyone is familiar with discord.py and could tell me why this isn't working, please do. It's really troubling me and I have tried everything in my knowledge to fix it.

                #find raiding
                        voice_channel = discord.utils.get(ctx.message.server.channels, id = '440014722587426816')
                
                        #finds the members
                        members = voice_channel.voice_members
                
                        memids = []
                
                        for member in members:
                            memids.append(member.id)
                
                        print(memids)
                

                推荐答案

                如果你知道频道的id,你可以这样做.为我工作:D

                If you know the id of the channel you can do it this way. Works for me :D

                channel = client.get_channel(1234567890) #gets the channel you want to get the list from
                
                members = channel.members #finds members connected to the channel
                
                memids = [] #(list)
                for member in members:
                    memids.append(member.id)
                
                print(memids) #print info
                

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

                上一篇:discord.py 中 on_message 的冷却时间 下一篇:在 message.guild.get_member_named("member_name") 中

                相关文章

                最新文章

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

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

                  1. <legend id='JEuHS'><style id='JEuHS'><dir id='JEuHS'><q id='JEuHS'></q></dir></style></legend>

                    <tfoot id='JEuHS'></tfoot>

                    • <bdo id='JEuHS'></bdo><ul id='JEuHS'></ul>