mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 17:36:15 +00:00
Add support for 'linked role' role tag
This commit is contained in:
@ -77,6 +77,7 @@ class RoleTags:
|
||||
'_premium_subscriber',
|
||||
'_available_for_purchase',
|
||||
'subscription_listing_id',
|
||||
'_guild_connections',
|
||||
)
|
||||
|
||||
def __init__(self, data: RoleTagPayload):
|
||||
@ -90,6 +91,7 @@ class RoleTags:
|
||||
# Which means we would need a different sentinel.
|
||||
self._premium_subscriber: Optional[Any] = data.get('premium_subscriber', MISSING)
|
||||
self._available_for_purchase: Optional[Any] = data.get('available_for_purchase', MISSING)
|
||||
self._guild_connections: Optional[Any] = data.get('guild_connections', MISSING)
|
||||
|
||||
def is_bot_managed(self) -> bool:
|
||||
""":class:`bool`: Whether the role is associated with a bot."""
|
||||
@ -110,6 +112,13 @@ class RoleTags:
|
||||
"""
|
||||
return self._available_for_purchase is None
|
||||
|
||||
def is_guild_connection(self) -> bool:
|
||||
""":class:`bool`: Whether the role is a guild's linked role.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
"""
|
||||
return self._guild_connections is None
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return (
|
||||
f'<RoleTags bot_id={self.bot_id} integration_id={self.integration_id} '
|
||||
|
Reference in New Issue
Block a user