From 1954861668f0dd71ea141afa05aeabce1d4d0578 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 27 May 2021 21:11:17 -0400 Subject: [PATCH] Add warning for comparing with role positioning --- discord/role.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/discord/role.py b/discord/role.py index 22778f8e9..a8ce4cea0 100644 --- a/discord/role.py +++ b/discord/role.py @@ -139,6 +139,15 @@ class Role(Hashable): position: :class:`int` The position of the role. This number is usually positive. The bottom role has a position of 0. + + .. warning:: + + Multiple roles can have the same position number. As a consequence + of this, comparing via role position is prone to subtle bugs if + checking for role hierarchy. The recommended and correct way to + compare for roles in the hierarchy is using the comparison + operators on the role objects themselves. + managed: :class:`bool` Indicates if the role is managed by the guild through some form of integrations such as Twitch.