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(flags): implement new member flags #1246

Merged
merged 7 commits into from
Nov 26, 2024
Merged
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
1 change: 1 addition & 0 deletions changelog/1245.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement :attr:`~MemberFlags.is_guest`, :attr:`~MemberFlags.started_home_actions`, :attr:`~MemberFlags.completed_home_actions`, :attr:`~MemberFlags.automod_quarantined_username`, :attr:`~MemberFlags.dm_settings_upsell_acknowledged` new member flags.
45 changes: 45 additions & 0 deletions disnake/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2343,9 +2343,14 @@ class MemberFlags(BaseFlags):
def __init__(
self,
*,
automod_quarantined_username: bool = ...,
bypasses_verification: bool = ...,
completed_home_actions: bool = ...,
completed_onboarding: bool = ...,
did_rejoin: bool = ...,
dm_settings_upsell_acknowledged: bool = ...,
is_guest: bool = ...,
started_home_actions: bool = ...,
started_onboarding: bool = ...,
) -> None:
...
Expand All @@ -2370,6 +2375,46 @@ def started_onboarding(self):
""":class:`bool`: Returns ``True`` if the member has started onboarding."""
return 1 << 3

@flag_value
def is_guest(self):
""":class:`bool`: Returns ``True`` if the member is a guest and can only access the voice channel they were invited to.

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

@flag_value
def started_home_actions(self):
""":class:`bool`: Returns ``True`` if the member has started the Server Guide actions.

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

@flag_value
def completed_home_actions(self):
""":class:`bool`: Returns ``True`` if the member has completed the Server Guide actions.

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

@flag_value
def automod_quarantined_username(self):
""":class:`bool`: Returns ``True`` if the member's username, display name, or nickname is blocked by AutoMod.

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

@flag_value
def dm_settings_upsell_acknowledged(self):
""":class:`bool`: Returns ``True`` if the member has dismissed the DM settings upsell.

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


class RoleFlags(BaseFlags):
"""Wraps up Discord Role flags.
Expand Down
Loading