mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-27 17:23:00 +00:00
discord: Add StickerURLWithType
This commit adds the StickerURLWithType methods into Sticker and StickerItem types. No Lottie support is added yet, because I'm not sure what the filename format for that is.
This commit is contained in:
parent
4b6bc657dc
commit
e09abfdbcb
|
@ -202,6 +202,13 @@ type StickerItem struct {
|
|||
FormatType StickerFormatType `json:"format_type"`
|
||||
}
|
||||
|
||||
// StickerURLWithType returns the URL to the emoji's image.
|
||||
//
|
||||
// Supported ImageTypes: PNG
|
||||
func (s StickerItem) StickerURLWithType(t ImageType) string {
|
||||
return "https://cdn.discordapp.com/stickers/" + t.format(s.ID.String())
|
||||
}
|
||||
|
||||
// https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
|
||||
type Sticker struct {
|
||||
// ID is the ID of the sticker.
|
||||
|
@ -250,6 +257,13 @@ func (s Sticker) TagList() []string {
|
|||
return tags
|
||||
}
|
||||
|
||||
// StickerURLWithType returns the URL to the emoji's image.
|
||||
//
|
||||
// Supported ImageTypes: PNG
|
||||
func (s Sticker) StickerURLWithType(t ImageType) string {
|
||||
return "https://cdn.discordapp.com/stickers/" + t.format(s.ID.String())
|
||||
}
|
||||
|
||||
type StickerType int
|
||||
|
||||
// https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types
|
||||
|
|
Loading…
Reference in a new issue