Change internal role storage in Guild to a dict instead of a list.
This adds the following APIs: * Guild.get_role This removes the following APIs: * Guild.role_hierarchy To compensate for the removed APIs, Guild.roles is now a sorted list based on hierarchy. The first element will always be the @everyone role. This speeds up access at the cost of some memory, theoretically.
This commit is contained in:
@ -309,7 +309,7 @@ class Message:
|
||||
self.role_mentions = []
|
||||
if self.guild is not None:
|
||||
for role_id in map(int, role_mentions):
|
||||
role = utils.get(self.guild.roles, id=role_id)
|
||||
role = self.guild.get_role(role_id)
|
||||
if role is not None:
|
||||
self.role_mentions.append(role)
|
||||
|
||||
|
Reference in New Issue
Block a user