Skip to content

Commit 5ac16bb

Browse files
committed
🩹 Fix error when tags is None
1 parent 9801d5c commit 5ac16bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

discord/role.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ class RoleType(IntEnum):
121121
122122
Attributes
123123
----------
124+
NORMAL: :class:`int`
125+
The role is a normal role.
124126
APPLICATION: :class:`int`
125127
The role is an application (bot) role.
126128
BOOSTER: :class:`int`
@@ -141,6 +143,7 @@ class RoleType(IntEnum):
141143
The role type is unknown.
142144
"""
143145

146+
NORMAL = 0
144147
APPLICATION = 1
145148
BOOSTER = 2
146149
GUILD_PRODUCT = 3
@@ -561,7 +564,7 @@ def type(self) -> RoleType:
561564
562565
.. versionadded:: 2.7
563566
"""
564-
return self.tags.type
567+
return self.tags.type if self.tags is not None else RoleType.NORMAL
565568

566569
async def _move(self, position: int, reason: str | None) -> None:
567570
if position <= 0:

0 commit comments

Comments
 (0)