discord.py - Getting all available roles of a guild

为君一笑 提交于 2020-06-01 07:07:14

问题


I notice there is a method for the Guild object for fetching all roles of a guild. My problem is that I cannot install discord.py==1.3.0 using pip. Is there another way to get all the guild's roles in discord.py==1.2.3?


回答1:


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.

Once you have list of roles you can iterate through it and get its name, id etc.

Documentation




回答2:


Download it here: https://pypi.org/project/discord.py/#files and follow the instructions to import



来源:https://stackoverflow.com/questions/56919488/discord-py-getting-all-available-roles-of-a-guild

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!