本文介绍了如何使用 discord.py 获取语音频道的所有成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有问题,如果我将所有成员作为特定语音频道的 Meber 的对象.我只得到一个空列表.
I have the problem, if I will get all members as an object of Meber of a specific Voice-channel. I only get a empty list back.
这是我的代码:
我该如何解决这个问题?
How can I fix this Problem?
推荐答案
你必须像这样在 bot = ...
之前启用 Intents.members
:
You have to enable Intents.members
like this before bot = ...
:
并更新 bot = ..
以包含参数 intents=intents
.
and update the bot = ..
to include the argument intents=intents
.
您还必须在您的应用程序站点中启用不和谐的成员意图(
Also you have to enable member intents in your application site in discord (go here, click on your bot, click on bot
at the sidebar and enable them.):
参考资料:
discord.Intents.members
这篇关于如何使用 discord.py 获取语音频道的所有成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
【网站声明】本站部分内容来源于互联网,旨在帮助大家更快的解决问题,如果有图片或者内容侵犯了您的权益,请联系我们删除处理,感谢您的支持!