Skip to content

Commit 9f2fda7

Browse files
authored
feat: add support for editing member flags (#1601)
#1553
1 parent 1d31d96 commit 9f2fda7

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

interactions/api/http/http_requests/members.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ async def modify_guild_member(
8282
deaf: bool | None = None,
8383
channel_id: "Snowflake_Type | MISSING" = MISSING,
8484
communication_disabled_until: str | datetime | Timestamp | None | Missing = MISSING,
85+
flags: int | Missing = MISSING,
8586
reason: str | None = None,
8687
) -> discord_typings.GuildMemberData:
8788
"""
@@ -96,6 +97,7 @@ async def modify_guild_member(
9697
deaf: Whether the user is deafened in voice channels
9798
channel_id: id of channel to move user to (if they are connected to voice)
9899
communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again
100+
flags: Represents the guild member flags
99101
reason: An optional reason for the audit log
100102
101103
Returns:
@@ -118,6 +120,8 @@ async def modify_guild_member(
118120
payload["nick"] = nickname
119121
if not isinstance(communication_disabled_until, Missing):
120122
payload["communication_disabled_until"] = communication_disabled_until
123+
if not isinstance(flags, Missing):
124+
payload["flags"] = flags
121125

122126
result = await self.request(
123127
Route("PATCH", "/guilds/{guild_id}/members/{user_id}", guild_id=guild_id, user_id=user_id),

interactions/models/discord/user.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ async def edit(
640640
deaf: Absent[bool] = MISSING,
641641
channel_id: Absent["Snowflake_Type"] = MISSING,
642642
communication_disabled_until: Absent[Union["Timestamp", None]] = MISSING,
643+
flags: Absent[int] = MISSING,
643644
reason: Absent[str] = MISSING,
644645
) -> None:
645646
"""
@@ -652,6 +653,7 @@ async def edit(
652653
deaf: Whether the user is deafened in voice channels
653654
channel_id: id of channel to move user to (if they are connected to voice)
654655
communication_disabled_until: when the user's timeout will expire and the user will be able to communicate in the guild again
656+
flags: Represents the guild member flags
655657
reason: An optional reason for the audit log
656658
"""
657659
await self._client.http.modify_guild_member(
@@ -663,6 +665,7 @@ async def edit(
663665
deaf=deaf,
664666
channel_id=channel_id,
665667
communication_disabled_until=communication_disabled_until,
668+
flags=flags,
666669
reason=reason,
667670
)
668671

interactions/models/discord/user.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ class Member(FakeUserMixin):
162162
deaf: Absent[bool] = ...,
163163
channel_id: Absent["Snowflake_Type"] = ...,
164164
communication_disabled_until: Absent[Union["Timestamp", None]] = ...,
165+
flags: Absent[int] = ...,
165166
reason: Absent[str] = ...
166167
) -> None: ...
167168
async def kick(self, reason: Absent[str] = ...) -> None: ...

0 commit comments

Comments
 (0)