1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-10-31 20:14:21 +00:00
arikawa/discord/url.go
Maximilian von Lindern 2c98f4e8e4
Discord: fix typo
2020-05-15 22:13:15 +02:00

35 lines
654 B
Go

package discord
import "strings"
type ImageType string
const (
// AutoImage chooses automatically between a PNG and GIF.
AutoImage ImageType = "auto"
// JPEGImage is the JPEG image type.
JPEGImage ImageType = ".jpeg"
// PNGImage is the PNG image type.
PNGImage ImageType = ".png"
// WebPImage is the WebP image type.
WebPImage ImageType = ".webp"
// GIFImage is the GIF image type.
GIFImage ImageType = ".gif"
)
func (t ImageType) format(name string) string {
if t == AutoImage {
if strings.HasPrefix(name, "a_") {
return name + ".gif"
}
return name + ".png"
}
return name + string(t)
}
type URL = string
type Hash = string