小编Mat*_*pie的帖子

(discord.py) 获取特定语音频道中所有成员的列表

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

如果有人熟悉 discord.py 并且可以告诉我为什么这不起作用,请告诉我。这真的让我很困扰,我已经尽我所知尝试了一切来解决它。

#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)
Run Code Online (Sandbox Code Playgroud)

python python-3.x discord discord.py

7
推荐指数
1
解决办法
3万
查看次数

标签 统计

discord ×1

discord.py ×1

python ×1

python-3.x ×1