aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRapptz <[email protected]>2018-09-24 21:05:41 -0400
committerRapptz <[email protected]>2018-09-24 21:08:48 -0400
commit3d03dbc45179f645b59838729047e896cc387049 (patch)
tree63592f4d631c33ee0b22b7f6bb57818ad48b2671 /docs
parentTake the default role property into account when comparing roles. (diff)
downloaddiscord.py-3d03dbc45179f645b59838729047e896cc387049.tar.xz
discord.py-3d03dbc45179f645b59838729047e896cc387049.zip
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.
Diffstat (limited to 'docs')
-rw-r--r--docs/migrating.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/migrating.rst b/docs/migrating.rst
index 074cc2d6..3e9def24 100644
--- a/docs/migrating.rst
+++ b/docs/migrating.rst
@@ -368,11 +368,17 @@ They will be enumerated here.
- Use :attr:`Member.activity` instead.
+- ``Guild.role_hierarchy`` / ``Server.role_hierarchy``
+
+ - Use :attr:`Guild.roles` instead. Note that while sorted, it is in the opposite order
+ of what the old ``Guild.role_hierarchy`` used to be.
+
**Changed**
- :attr:`Member.avatar_url` and :attr:`User.avatar_url` now return the default avatar if a custom one is not set.
- :attr:`Message.embeds` is now a list of :class:`Embed` instead of ``dict`` objects.
- :attr:`Message.attachments` is now a list of :class:`Attachment` instead of ``dict`` object.
+- :attr:`Guild.roles` is now sorted through hierarchy. The first element is always the ``@everyone`` role.
**Added**
@@ -398,6 +404,7 @@ They will be enumerated here.
- :attr:`Message.activity` and :attr:`Message.application` for Rich Presence related information.
- :meth:`TextChannel.is_nsfw` to check if a text channel is NSFW.
- :meth:`Colour.from_rgb` to construct a :class:`Colour` from RGB tuple.
+- :meth:`Guild.get_role` to get a role by its ID.
.. _migrating_1_0_sending_messages: