Skip to content

Commit 639b42f

Browse files
authored
Update guild.py
Signed-off-by: plun1331 <[email protected]>
1 parent a24b431 commit 639b42f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

discord/guild.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,6 +3093,29 @@ async def unban(self, user: Snowflake, *, reason: str | None = None) -> None:
30933093
"""
30943094
await self._state.http.unban(user.id, self.id, reason=reason)
30953095

3096+
async def add_member_roles(self, member: int, role: Role, *, reason: str | None = None) -> None:
3097+
"""|coro|
3098+
3099+
Adds a role to a guild member with the specified ID.
3100+
3101+
Parameters
3102+
----------
3103+
member: :class:`int`
3104+
The member's ID.
3105+
role: :class:`Role`
3106+
The role to add.
3107+
reason: Optional[:class:`str`]
3108+
The reason for doing this action. Shows up on the audit log.
3109+
3110+
Raises
3111+
------
3112+
Forbidden
3113+
You do not have the proper permissions to add the role.
3114+
HTTPException
3115+
Role adding failed.
3116+
"""
3117+
await self._state.http.add_role(self.id, member, role.id, reason=reason)
3118+
30963119
async def vanity_invite(self) -> Invite | None:
30973120
"""|coro|
30983121

0 commit comments

Comments
 (0)