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

Add "USE_CLYDE_AI" permission #1090

Closed
wants to merge 15 commits into from
1 change: 1 addition & 0 deletions changelog/1090.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `USE_CLYDE_AI` permission
MCausc78 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions disnake/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ async def set_permissions(
start_embedded_activities: Optional[bool] = ...,
stream: Optional[bool] = ...,
use_application_commands: Optional[bool] = ...,
use_clyde_ai: Optional[bool] = ...,
use_embedded_activities: Optional[bool] = ...,
use_external_emojis: Optional[bool] = ...,
use_external_sounds: Optional[bool] = ...,
Expand Down
1 change: 1 addition & 0 deletions disnake/ext/commands/base_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ def default_member_permissions(
start_embedded_activities: bool = ...,
stream: bool = ...,
use_application_commands: bool = ...,
use_clyde_ai: bool = ...,
use_embedded_activities: bool = ...,
use_external_emojis: bool = ...,
use_external_sounds: bool = ...,
Expand Down
4 changes: 4 additions & 0 deletions disnake/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,7 @@ def has_permissions(
start_embedded_activities: bool = ...,
stream: bool = ...,
use_application_commands: bool = ...,
use_clyde_ai: bool = ...,
use_embedded_activities: bool = ...,
use_external_emojis: bool = ...,
use_external_sounds: bool = ...,
Expand Down Expand Up @@ -2171,6 +2172,7 @@ def bot_has_permissions(
start_embedded_activities: bool = ...,
stream: bool = ...,
use_application_commands: bool = ...,
use_clyde_ai: bool = ...,
use_embedded_activities: bool = ...,
use_external_emojis: bool = ...,
use_external_sounds: bool = ...,
Expand Down Expand Up @@ -2271,6 +2273,7 @@ def has_guild_permissions(
start_embedded_activities: bool = ...,
stream: bool = ...,
use_application_commands: bool = ...,
use_clyde_ai: bool = ...,
use_embedded_activities: bool = ...,
use_external_emojis: bool = ...,
use_external_sounds: bool = ...,
Expand Down Expand Up @@ -2368,6 +2371,7 @@ def bot_has_guild_permissions(
start_embedded_activities: bool = ...,
stream: bool = ...,
use_application_commands: bool = ...,
use_clyde_ai: bool = ...,
use_embedded_activities: bool = ...,
use_external_emojis: bool = ...,
use_external_sounds: bool = ...,
Expand Down
17 changes: 17 additions & 0 deletions disnake/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def __init__(
start_embedded_activities: bool = ...,
stream: bool = ...,
use_application_commands: bool = ...,
use_clyde_ai: bool = ...,
use_embedded_activities: bool = ...,
use_external_emojis: bool = ...,
use_external_sounds: bool = ...,
Expand Down Expand Up @@ -396,6 +397,9 @@ def text(cls) -> Self:

.. versionchanged:: 2.9
Added :attr:`send_voice_messages` permission.

.. versionchanged:: 2.10
Added :attr:`use_clyde_ai` permission.
MCausc78 marked this conversation as resolved.
Show resolved Hide resolved
"""
return cls(
send_messages=True,
Expand All @@ -414,6 +418,7 @@ def text(cls) -> Self:
send_tts_messages=True,
use_slash_commands=True,
send_voice_messages=True,
use_clyde_ai=True,
)

@classmethod
Expand Down Expand Up @@ -569,6 +574,7 @@ def update(
start_embedded_activities: bool = ...,
stream: bool = ...,
use_application_commands: bool = ...,
use_clyde_ai: bool = ...,
use_embedded_activities: bool = ...,
use_external_emojis: bool = ...,
use_external_sounds: bool = ...,
Expand Down Expand Up @@ -994,6 +1000,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 use Clyde AI.
MCausc78 marked this conversation as resolved.
Show resolved Hide resolved

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


def _augment_from_permissions(cls):
cls.VALID_NAMES = set(Permissions.VALID_FLAGS)
Expand Down Expand Up @@ -1103,6 +1117,7 @@ class PermissionOverwrite:
start_embedded_activities: Optional[bool]
stream: Optional[bool]
use_application_commands: Optional[bool]
use_clyde_ai: Optional[bool]
use_embedded_activities: Optional[bool]
use_external_emojis: Optional[bool]
use_external_sounds: Optional[bool]
Expand Down Expand Up @@ -1167,6 +1182,7 @@ def __init__(
start_embedded_activities: Optional[bool] = ...,
stream: Optional[bool] = ...,
use_application_commands: Optional[bool] = ...,
use_clyde_ai: Optional[bool] = ...,
use_embedded_activities: Optional[bool] = ...,
use_external_emojis: Optional[bool] = ...,
use_external_sounds: Optional[bool] = ...,
Expand Down Expand Up @@ -1298,6 +1314,7 @@ def update(
start_embedded_activities: Optional[bool] = ...,
stream: Optional[bool] = ...,
use_application_commands: Optional[bool] = ...,
use_clyde_ai: Optional[bool] = ...,
use_embedded_activities: Optional[bool] = ...,
use_external_emojis: Optional[bool] = ...,
use_external_sounds: Optional[bool] = ...,
Expand Down