Skip to content

Commit

Permalink
feat(flags): implement new member flags (#1246)
Browse files Browse the repository at this point in the history
Signed-off-by: Snipy7374 <[email protected]>
  • Loading branch information
Snipy7374 authored Nov 26, 2024
1 parent 2d0f91a commit 795316e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
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

0 comments on commit 795316e

Please sign in to comment.