From c2e735b5e8cdd3e047123c8090a834a57ddf77b8 Mon Sep 17 00:00:00 2001 From: Bastien1533 Date: Mon, 29 Jan 2024 22:41:55 +0100 Subject: [PATCH] feat: Add support for editing member flags #1553 --- interactions/api/http/http_requests/members.py | 4 ++++ interactions/models/discord/user.py | 3 +++ interactions/models/discord/user.pyi | 1 + 3 files changed, 8 insertions(+) diff --git a/interactions/api/http/http_requests/members.py b/interactions/api/http/http_requests/members.py index 271351aac..4080e558c 100644 --- a/interactions/api/http/http_requests/members.py +++ b/interactions/api/http/http_requests/members.py @@ -82,6 +82,7 @@ async def modify_guild_member( deaf: bool | None = None, channel_id: "Snowflake_Type | MISSING" = MISSING, communication_disabled_until: str | datetime | Timestamp | None | Missing = MISSING, + flags: int | Missing = MISSING, reason: str | None = None, ) -> discord_typings.GuildMemberData: """ @@ -96,6 +97,7 @@ async def modify_guild_member( deaf: Whether the user is deafened in voice channels channel_id: id of channel to move user to (if they are connected to voice) communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again + flags: Represents the guild member flags reason: An optional reason for the audit log Returns: @@ -118,6 +120,8 @@ async def modify_guild_member( payload["nick"] = nickname if not isinstance(communication_disabled_until, Missing): payload["communication_disabled_until"] = communication_disabled_until + if not isinstance(flags, Missing): + payload["flags"] = flags result = await self.request( Route("PATCH", "/guilds/{guild_id}/members/{user_id}", guild_id=guild_id, user_id=user_id), diff --git a/interactions/models/discord/user.py b/interactions/models/discord/user.py index 2cd6857ea..b32d31f85 100644 --- a/interactions/models/discord/user.py +++ b/interactions/models/discord/user.py @@ -640,6 +640,7 @@ async def edit( deaf: Absent[bool] = MISSING, channel_id: Absent["Snowflake_Type"] = MISSING, communication_disabled_until: Absent[Union["Timestamp", None]] = MISSING, + flags: Absent[int] = MISSING, reason: Absent[str] = MISSING, ) -> None: """ @@ -652,6 +653,7 @@ async def edit( deaf: Whether the user is deafened in voice channels channel_id: id of channel to move user to (if they are connected to voice) communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again + flags: Represents the guild member flags reason: An optional reason for the audit log """ await self._client.http.modify_guild_member( @@ -663,6 +665,7 @@ async def edit( deaf=deaf, channel_id=channel_id, communication_disabled_until=communication_disabled_until, + flags=flags, reason=reason, ) diff --git a/interactions/models/discord/user.pyi b/interactions/models/discord/user.pyi index 9119afff3..c91508c6e 100644 --- a/interactions/models/discord/user.pyi +++ b/interactions/models/discord/user.pyi @@ -162,6 +162,7 @@ class Member(FakeUserMixin): deaf: Absent[bool] = ..., channel_id: Absent["Snowflake_Type"] = ..., communication_disabled_until: Absent[Union["Timestamp", None]] = ..., + flags: Absent[int] = ..., reason: Absent[str] = ... ) -> None: ... async def kick(self, reason: Absent[str] = ...) -> None: ...