mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-11 19:07:28 +03:00
feat(guild): adding and removing role from user
This commit is contained in:
parent
191b68b4f1
commit
8a418803f4
1 changed files with 30 additions and 0 deletions
|
@ -621,6 +621,36 @@ class Guild(APIModelBase):
|
|||
"""
|
||||
|
||||
await self._client.rest.remove_guild_ban(self.id, user_id, reason=reason)
|
||||
|
||||
async def add_role(
|
||||
self,
|
||||
*,
|
||||
user_id: Union[Snowflake, str, int],
|
||||
role_id: Union[Snowflake, str, int],
|
||||
reason: Optional[str] = None
|
||||
):
|
||||
#TODO: Add description
|
||||
|
||||
await self._http.put(
|
||||
f"/guilds/{self.id}/members/{user_id}/roles/{role_id}",
|
||||
headers = {
|
||||
"X-Audit-Log-Reason": reason
|
||||
})
|
||||
|
||||
async def delete_role(
|
||||
self,
|
||||
*,
|
||||
user_id: Union[Snowflake, str, int],
|
||||
role_id: Union[Snowflake, str, int],
|
||||
reason: Optional[str] = None
|
||||
):
|
||||
#TODO: add description :D
|
||||
|
||||
await self._http.delete(
|
||||
f"/guilds/{self.id}/members/{user_id}/roles/{role_id}",
|
||||
headers = {
|
||||
"X-Audit-Log-Reason": reason
|
||||
})
|
||||
|
||||
|
||||
@dataclass(repr=False)
|
||||
|
|
Loading…
Reference in a new issue