Skip to content
Closed
2 changes: 2 additions & 0 deletions discord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
from .poll import *
from .soundboard import *
from .subscription import *
from .clan import *
from .member_verification import *


class VersionInfo(NamedTuple):
Expand Down
18 changes: 18 additions & 0 deletions discord/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,24 @@ def _from_user_banner(cls, state: _State, user_id: int, banner_hash: str) -> Sel
animated=animated,
)

@classmethod
def _from_clan_badge(cls, state: _State, guild_id: int, badge_hash: str) -> Self:
return cls(
state,
url=f'{cls.BASE}/clan-badges/{guild_id}/{badge_hash}.png',
key=badge_hash,
animated=False,
)

@classmethod
def _from_clan_banner(cls, state: _State, guild_id: int, banner_hash: str) -> Self:
return cls(
state,
url=f'{cls.BASE}/clan-banners/{guild_id}/{banner_hash}.png',
key=banner_hash,
animated=False,
)

def __str__(self) -> str:
return self._url

Expand Down
Loading
Loading