Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add use_clyde_ai permission and role subscription purchase notifications to SystemChannelFlags #2224

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ These changes are available on the `master` branch, but have not yet been releas
([#2206](https://github.com/Pycord-Development/pycord/pull/2206))
- Added function `Guild.delete_auto_moderation_rule`.
([#2153](https://github.com/Pycord-Development/pycord/pull/2153))
- Added
[`USE_CLYDE_AI` permission](https://github.com/discord/discord-api-docs/pull/6354).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the role subscription purchase notifications flag?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ + the changelog entry is entirely wrong

([#2224](https://github.com/Pycord-Development/pycord/pull/2224))

### Changed

Expand Down
24 changes: 20 additions & 4 deletions discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,28 +255,44 @@ def _set_flag(self, o: int, toggle: bool) -> None:
@flag_value
def join_notifications(self):
""":class:`bool`: Returns ``True`` if the system channel is used for member join notifications."""
return 1
return 1 << 0

@flag_value
def premium_subscriptions(self):
""":class:`bool`: Returns ``True`` if the system channel is used for "Nitro boosting" notifications."""
return 2
return 1 << 1

@flag_value
def guild_reminder_notifications(self):
""":class:`bool`: Returns ``True`` if the system channel is used for server setup helpful tips notifications.

.. versionadded:: 2.0
"""
return 4
return 1 << 2

@flag_value
def join_notification_replies(self):
""":class:`bool`: Returns ``True`` if the system channel is allowing member join sticker replies.

.. versionadded:: 2.0
"""
return 8
return 1 << 3

@flag_value
def role_subscription_purchase_notifications(self):
""":class:`bool`: Returns ``True`` if the system channel is used for role subscription purchase and renewal notifications.

.. versionadded:: 2.5
"""
return 1 << 4

@flag_value
def role_subscription_purchase_notifications_replies(self):
""":class:`bool`: Returns ``True`` if the system channel is allowing role subscription purchase sticker replies.

.. versionadded:: 2.5
"""
return 1 << 5


@fill_with_flags()
Expand Down
16 changes: 14 additions & 2 deletions discord/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def all(cls: type[P]) -> P:
"""A factory method that creates a :class:`Permissions` with all
permissions set to ``True``.
"""
return cls(0b11111111111111111111111111111111111111111)
return cls(0b110000011111111111111111111111111111111111111111)

@classmethod
def all_channel(cls: type[P]) -> P:
Expand Down Expand Up @@ -242,8 +242,11 @@ def text(cls: type[P]) -> P:
.. versionchanged:: 2.0
Added :attr:`create_public_threads`, :attr:`create_private_threads`, :attr:`manage_threads`,
:attr:`send_messages_in_threads` and :attr:`use_external_stickers` permissions.

.. versionchanged:: 2.5
Added :attr:`use_clyde_ai` permission.
"""
return cls(0b111110010000000000001111111100001000000)
return cls(0b100000000111110010000000000001111111100001000000)

@classmethod
def voice(cls: type[P]) -> P:
Expand Down Expand Up @@ -618,6 +621,14 @@ def send_voice_messages(self) -> int:
"""
return 1 << 46

@flag_value
def use_clyde_ai(self) -> int:
""":class:`bool`: Returns ``True`` if a user can interact with the Clyde AI bot.

.. versionadded:: 2.5
"""
return 1 << 47


PO = TypeVar("PO", bound="PermissionOverwrite")

Expand Down Expand Up @@ -736,6 +747,7 @@ class PermissionOverwrite:
start_embedded_activities: bool | None
moderate_members: bool | None
send_voice_messages: bool | None
use_clyde_ai: bool | None

def __init__(self, **kwargs: bool | None):
self._values: dict[str, bool | None] = {}
Expand Down
Loading