mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-11 19:07:28 +03:00
remove senpais code
This commit is contained in:
parent
1857a2eefd
commit
2d179ff11a
3 changed files with 26 additions and 31 deletions
|
@ -622,37 +622,6 @@ 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):
|
||||
"""A partial guild object.
|
||||
|
|
|
@ -86,3 +86,13 @@ class Role(APIModelBase):
|
|||
return None
|
||||
else:
|
||||
return self._client.cache.get_guild(self.guild_id)
|
||||
|
||||
def icon_url(self, *, size: int = 1024, image_format: str = None):
|
||||
# ToDo: Add Docstrings
|
||||
"""Icon Url (from the Discord CDN server)"""
|
||||
if self.icon is None:
|
||||
return None
|
||||
else:
|
||||
return self._client.rest.cdn.role_icon_url(
|
||||
self.id, self.icon, size=size, image_format=image_format
|
||||
)
|
||||
|
|
|
@ -720,3 +720,19 @@ class CDNBuilder:
|
|||
image_format if image_format is not None else self.dif,
|
||||
size,
|
||||
)
|
||||
|
||||
def role_icon_url(
|
||||
self,
|
||||
role_id: str,
|
||||
_hash: str,
|
||||
*,
|
||||
size: int = 1024,
|
||||
image_format: str = None,
|
||||
):
|
||||
return "{}/role-icons/{}/{}.{}?size={}".format(
|
||||
self.BASE_URL,
|
||||
role_id,
|
||||
_hash,
|
||||
image_format if image_format is not None else self.dif,
|
||||
size,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue