Source code for wow._async.resources.guild_crest

 1"""Routes of the Guild Crest API."""
 2
 3from wow._async._resource import AsyncResource
 4from wow.models._common import Media
 5from wow.models.guild_crest import GuildCrestComponentsIndex
 6
 7__all__ = ["AsyncGuildCrests"]
 8
 9
[docs] 10class AsyncGuildCrests(AsyncResource): 11 """``client.guild_crests``: the emblems, borders and colors guild crests use.""" 12 13 __slots__ = () 14
[docs] 15 async def index(self) -> GuildCrestComponentsIndex: 16 """List every selectable emblem, border and color.""" 17 return await self._get("static", "/data/wow/guild-crest/index", GuildCrestComponentsIndex)
18
[docs] 19 async def border_media(self, border_id: int) -> Media: 20 """Get a crest border's rendered image.""" 21 return await self._get("static", f"/data/wow/media/guild-crest/border/{border_id}", Media)
22
[docs] 23 async def emblem_media(self, emblem_id: int) -> Media: 24 """Get a crest emblem's rendered image.""" 25 return await self._get("static", f"/data/wow/media/guild-crest/emblem/{emblem_id}", Media)