问题
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