Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
696dcbf
:recycle: Rewrite `RoleTags.bot_id` handling
Paillat-dev Feb 6, 2025
54d030d
:recycle: Rewrite this mess
Paillat-dev Feb 6, 2025
5810fa3
:sparkles: Things
Paillat-dev Feb 15, 2025
6a91875
:bug: Who tf made this messed up system
Paillat-dev Feb 15, 2025
54f1baa
:memo: Better docs
Paillat-dev Feb 15, 2025
9801d5c
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Feb 15, 2025
5ac16bb
:adhesive_bandage: Fix error when tags is None
Paillat-dev Feb 16, 2025
304d70b
:memo: CHANGELOG.md
Paillat-dev Feb 16, 2025
7357716
Merge remote-tracking branch 'origin/master' into feat/role-tags-rewrite
Paillat-dev Feb 21, 2025
2dc7e65
Merge remote-tracking branch 'pycord/master' into feat/role-tags-rewrite
Paillat-dev Mar 2, 2025
3b34892
:label: Add missing typing
Paillat-dev Mar 4, 2025
3273324
Merge remote-tracking branch 'pycord/master' into feat/role-tags-rewrite
Paillat-dev Mar 24, 2025
1019b99
Merge remote-tracking branch 'origin/master' into feat/role-tags-rewrite
Paillat-dev Feb 13, 2026
8a96f8d
:memo: :recycle: Refactor role tag parsing and update versioning to 2.8
Paillat-dev Feb 13, 2026
b228e3e
:memo: Clarify comment on guild product role parsing in role tags
Paillat-dev Feb 13, 2026
f1ac594
:memo: Clarify and expand notes on role tag determination limitations
Paillat-dev Feb 13, 2026
a5bb30e
:memo: Update external link in role tags documentation
Paillat-dev Feb 13, 2026
4ea6253
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Feb 13, 2026
417523e
:memo: Reword issue reporting link in role tags documentation
Paillat-dev Feb 13, 2026
842e227
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Feb 17, 2026
dfa8012
Update discord/role.py
Paillat-dev Feb 17, 2026
173af11
Update discord/role.py
Paillat-dev Feb 17, 2026
1c2eb00
Update CHANGELOG.md
Paillat-dev Feb 17, 2026
39b6f07
Update discord/role.py
Paillat-dev Feb 17, 2026
4aae72a
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 17, 2026
77b9d41
Update discord/role.py
Paillat-dev Feb 18, 2026
3cc1c11
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 18, 2026
0db354f
:memo: Such as but not limited to
Paillat-dev Feb 18, 2026
8cfc356
:recycle: Plun
Paillat-dev Feb 18, 2026
d870733
:memo: Plun 2
Paillat-dev Feb 18, 2026
76f944b
:wastebasket: Deprecation notices in docs
Paillat-dev Feb 18, 2026
0ab7bf5
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Feb 18, 2026
314bc6e
:recycle: Cleanup & docs
Paillat-dev Feb 18, 2026
c27c52d
:memo: Comment and types
Paillat-dev Feb 18, 2026
d91b218
:memo: Fix docstrings
Paillat-dev Feb 18, 2026
cab1fe7
:bug: I asked claude and it found a bug
Paillat-dev Feb 18, 2026
ac183e8
:wastebasket: Deprecation in docstrings
Paillat-dev Feb 20, 2026
50381f6
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Feb 20, 2026
e3d8080
:recycle: Use PEP 702 Deprecation
Paillat-dev Feb 20, 2026
c275945
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Feb 20, 2026
a61d070
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Feb 21, 2026
0641487
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Mar 3, 2026
fefc776
Apply suggestion from @Paillat-dev
Paillat-dev Mar 4, 2026
38e2d0f
Merge branch 'master' into feat/role-tags-rewrite
Paillat-dev Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#3044](https://github.com/Pycord-Development/pycord/pull/3044))
- Added `Member.colours` and `Member.colors` properties.
([#3063](https://github.com/Pycord-Development/pycord/pull/3063))
- Added `RoleType` enum accessible via `Role.type` and `RoleTags.type`.
([#2708](https://github.com/Pycord-Development/pycord/pull/2708))
- Added `Colour.light_theme()`, `Colour.ash_theme()`, and `Colour.onyx_theme()`.
([#3043](https://github.com/Pycord-Development/pycord/pull/3043))
- Added `RadioGroup`, `CheckboxGroup`, and `Checkbox` for modals.
Expand Down Expand Up @@ -54,6 +56,10 @@ These changes are available on the `master` branch, but have not yet been releas

### Deprecated

- Deprecated `is_bot_managed`, `is_premium_subscriber`, `is_integration`,
`is_available_for_purchase`, and `is_guild_connections_role` in favor of `type` for
both `Role` and `RoleTags` .
([#2708](https://github.com/Pycord-Development/pycord/pull/2708))
- Deprecated `Colour.embed_background()`.
([#3043](https://github.com/Pycord-Development/pycord/pull/3043))
- Deprecated the `suppress` parameter in all applicable message-related methods in favor
Expand Down
51 changes: 51 additions & 0 deletions discord/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"PollLayoutType",
"MessageReferenceType",
"ThreadArchiveDuration",
"RoleType",
"SubscriptionStatus",
"SeparatorSpacingSize",
"SelectDefaultValueType",
Expand Down Expand Up @@ -1135,6 +1136,56 @@ class SelectDefaultValueType(Enum):
user = "user"


class RoleType(IntEnum):
"""Represents the type of role.

This is NOT provided by Discord but is rather computed based on :attr:`Role.tags`.

.. versionadded:: 2.8

Attributes
----------
NORMAL: :class:`int`
The role is a normal role.
APPLICATION: :class:`int`
The role is an application (bot) role.
BOOSTER: :class:`int`
The role is a guild's booster role.
GUILD_PRODUCT: :class:`int`
The role is a guild product role.

.. note::
This is not possible to determine at times because role tags seem to be missing altogether, notably when
a role is fetched. In such cases :attr:`Role.type` and :attr:`Role.tags` will both be :data:`None`.
PREMIUM_SUBSCRIPTION_BASE: :class:`int`
The role is a base subscription role.

.. note::
This is not possible to determine currently, will be :attr:`.INTEGRATION` if it's a base subscription.
PREMIUM_SUBSCRIPTION_TIER: :class:`int`
The role is a subscription role.
DRAFT_PREMIUM_SUBSCRIPTION_TIER: :class:`int`
The role is a draft subscription role.
INTEGRATION: :class:`int`
The role is an integration role, such as Twitch or YouTube, or a base subscription role.
CONNECTION: :class:`int`
The role is a guild connections role.
UNKNOWN: :class:`int`
The role type is unknown.
"""

NORMAL = 0
APPLICATION = 1
BOOSTER = 2
GUILD_PRODUCT = 3 # Not possible to determine *at times* because role tags seem to be missing altogether when fetched
PREMIUM_SUBSCRIPTION_BASE = 4 # Not possible to determine currently, will be INTEGRATION if it's a base subscription
PREMIUM_SUBSCRIPTION_TIER = 5
DRAFT_PREMIUM_SUBSCRIPTION_TIER = 6
INTEGRATION = 7
CONNECTION = 8
UNKNOWN = 9


class ApplicationEventWebhookStatus(Enum):
"""Represents the application event webhook status."""

Expand Down
Loading