Remedy.CDN (Remedy v0.6.3) View Source
Discord CDN interface.
Storing images and other assets can be painful, use this module to retreive assets from the discord cdn rather than storing them.
Each function takes the required parameters to directly access a resource.
Format
All images are returned as either a .png
or a .gif
if the asset is animated. This is done automatically.
Size
Images can be requested of a size in [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]
. This is given as an optional final argument to any of the functions in this module. Arguments given will be rounded to the next largest, or the largest size if you try to go over.
Missing Endpoints:
- sticker
- team icon
- role icon
- guild member icon
Link to this section Summary
Functions
Returns the url for the guilds icon.
Link to this section Types
Link to this section Functions
Specs
application_cover(Remedy.Schema.App.t(), size()) :: binary()
Specs
application_icon(Remedy.Schema.App.t(), size()) :: binary()
Specs
guild_banner(Remedy.Schema.Guild.t(), size()) :: binary()
Specs
guild_discovery_splash(Remedy.Schema.Guild.t(), size()) :: binary()
Specs
guild_icon(Remedy.Schema.Guild.t(), size()) :: binary()
Returns the url for the guilds icon.
Examples
iex> Remedy.API.get_guild!(872417560094732328) |> Remedy.CDN.guild_icon()
"https://cdn.discordapp.com/icons/872417560094732328/f817c5adaf96672c94a17de8e944f427.jpg?size=128"
iex> Remedy.API.get_guild!(872417560094732328) |> Remedy.CDN.guild_icon(100)
"https://cdn.discordapp.com/icons/872417560094732328/f817c5adaf96672c94a17de8e944f427.jpg?size=128"
iex> Remedy.CDN.guild_icon(872417560094732328, "f817c5adaf96672c94a17de8e944f427", "cheese")
"https://cdn.discordapp.com/icons/872417560094732328/f817c5adaf96672c94a17de8e944f427.jpg"
Specs
guild_splash(Remedy.Schema.Guild.t(), size()) :: binary()
Specs
user_avatar(Remedy.Schema.User.t(), size()) :: binary()
Specs
user_banner(Remedy.Schema.User.t(), size()) :: binary()