From bf22a4ac99438bfa2e468c1a5649b2a9c8490d5e Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Sat, 23 Nov 2024 00:10:49 +0100 Subject: [PATCH 1/6] feat: implement new member flags --- disnake/flags.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/disnake/flags.py b/disnake/flags.py index da3cba6904..1d74b25c35 100644 --- a/disnake/flags.py +++ b/disnake/flags.py @@ -2370,6 +2370,31 @@ 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 ony access the voice channel they were invited to.""" + return 1 << 4 + + @flag_value + def started_home_actions(self): + """:class:`bool`: Returns ``True`` if the member has started the Server Guide actions.""" + return 1 << 5 + + @flag_value + def completed_home_actions(self): + """:class:`bool`: Returns ``True`` if the member has completed the Server Guide actions.""" + 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.""" + return 1 << 7 + + @flag_value + def dm_settings_upsell_acknowledged(self): + """:class:`bool`: Returns ``True`` if the member has dismissed the DM settings upsell.""" + return 1 << 9 + class RoleFlags(BaseFlags): """Wraps up Discord Role flags. From 1d935e57aa0a18575fc5ca663c57f1733fc52929 Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Sat, 23 Nov 2024 00:15:15 +0100 Subject: [PATCH 2/6] add changelog message --- changelog/1245.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/1245.feature.rst diff --git a/changelog/1245.feature.rst b/changelog/1245.feature.rst new file mode 100644 index 0000000000..4256a93d6b --- /dev/null +++ b/changelog/1245.feature.rst @@ -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. From 29b27bcfe71bdac86da49e822dffdfdc5b5b9356 Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Sat, 23 Nov 2024 00:16:27 +0100 Subject: [PATCH 3/6] run codemod scripts --- disnake/flags.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/disnake/flags.py b/disnake/flags.py index 1d74b25c35..b26ae0c7bd 100644 --- a/disnake/flags.py +++ b/disnake/flags.py @@ -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: ... From 1733121050020ae9abb1bdc05885a0f19a7dba59 Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:17:53 +0100 Subject: [PATCH 4/6] Update disnake/flags.py Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> --- disnake/flags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disnake/flags.py b/disnake/flags.py index b26ae0c7bd..356a157248 100644 --- a/disnake/flags.py +++ b/disnake/flags.py @@ -2377,7 +2377,7 @@ def started_onboarding(self): @flag_value def is_guest(self): - """:class:`bool`: Returns ``True`` if the member is a guest and can ony access the voice channel they were invited to.""" + """:class:`bool`: Returns ``True`` if the member is a guest and can only access the voice channel they were invited to.""" return 1 << 4 @flag_value From 6aca37b7a9ba5075a62a4a30f959c2763e8cbea6 Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:28:18 +0100 Subject: [PATCH 5/6] Update changelog/1245.feature.rst Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com> Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> --- changelog/1245.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/1245.feature.rst b/changelog/1245.feature.rst index 4256a93d6b..03bb9cfd27 100644 --- a/changelog/1245.feature.rst +++ b/changelog/1245.feature.rst @@ -1 +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. +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. From 8cebbec838e9641853e16f1b344d110e571bdb15 Mon Sep 17 00:00:00 2001 From: Snipy7374 <100313469+Snipy7374@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:31:42 +0100 Subject: [PATCH 6/6] fix: add versionadded to docstrings --- disnake/flags.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/disnake/flags.py b/disnake/flags.py index 356a157248..de753b30ba 100644 --- a/disnake/flags.py +++ b/disnake/flags.py @@ -2377,27 +2377,42 @@ def started_onboarding(self): @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.""" + """: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.""" + """: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.""" + """: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.""" + """: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.""" + """:class:`bool`: Returns ``True`` if the member has dismissed the DM settings upsell. + + .. versionadded:: 2.10 + """ return 1 << 9