feat(guild): adding and removing role from user

This commit is contained in:
TheMisterSenpai 2022-06-01 18:14:53 +03:00
parent 191b68b4f1
commit 8a418803f4

View file

@ -622,6 +622,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)
class UnavailableGuild(APIModelBase):