discord.py-获取公会的所有可用角色

时间:2019-07-07 05:03:18

标签: python discord.py python-3.7 discord.py-rewrite

我注意到Guild对象有一个方法可以获取公会的所有角色。我的问题是我无法使用pip安装discord.py==1.3.0Method for Guild object only available for 1.3.0 是否有另一种方法可以在discord.py==1.2.3中获得公会的所有角色?

2 个答案:

答案 0 :(得分:0)

在此处下载:https://pypi.org/project/discord.py/#files,然后按照说明进行导入

答案 1 :(得分:0)

Returns a list of the guild’s roles in hierarchy order.

The first element of this list will be the lowest role in the hierarchy.

一旦有了角色列表,您就可以对其进行迭代并获取其名称,ID等。

https://www.w3schools.com/cssref/pr_grid.asp

相关问题