From 639b42f0c9ca48295e0bce059dc67f248edd4909 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Sun, 5 Nov 2023 18:14:08 -0800 Subject: [PATCH] Update guild.py Signed-off-by: plun1331 --- discord/guild.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/discord/guild.py b/discord/guild.py index 2f449beb60..7ce2a4d45b 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -3093,6 +3093,29 @@ async def unban(self, user: Snowflake, *, reason: str | None = None) -> None: """ await self._state.http.unban(user.id, self.id, reason=reason) + async def add_member_roles(self, member: int, role: Role, *, reason: str | None = None) -> None: + """|coro| + + Adds a role to a guild member with the specified ID. + + Parameters + ---------- + member: :class:`int` + The member's ID. + role: :class:`Role` + The role to add. + reason: Optional[:class:`str`] + The reason for doing this action. Shows up on the audit log. + + Raises + ------ + Forbidden + You do not have the proper permissions to add the role. + HTTPException + Role adding failed. + """ + await self._state.http.add_role(self.id, member, role.id, reason=reason) + async def vanity_invite(self) -> Invite | None: """|coro|