mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-28 01:33:10 +00:00
Discord: fix #105
This commit is contained in:
parent
ce38507fb0
commit
19b970bad7
|
@ -178,6 +178,25 @@ func (g Guild) SplashURLWithType(t ImageType) string {
|
|||
g.ID.String() + "/" + t.format(g.Splash)
|
||||
}
|
||||
|
||||
// DiscoverySplashURL returns the URL to the guild splash, which is the invite
|
||||
// page's background. This will always return a link to a PNG file.
|
||||
func (g Guild) DiscoverySplashURL() string {
|
||||
return g.DiscoverySplashURLWithType(PNGImage)
|
||||
}
|
||||
|
||||
// DiscoverySplashURLWithType returns the URL to the guild splash, which is the
|
||||
// invite page's background, using the passed ImageType.
|
||||
//
|
||||
// Supported ImageTypes: PNG, JPEG, WebP
|
||||
func (g Guild) DiscoverySplashURLWithType(t ImageType) string {
|
||||
if g.Splash == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
return "https://cdn.discordapp.com/splashes/" +
|
||||
g.ID.String() + "/" + t.format(g.Splash)
|
||||
}
|
||||
|
||||
// https://discord.com/developers/docs/resources/guild#guild-preview-object
|
||||
type GuildPreview struct {
|
||||
// ID is the guild id.
|
||||
|
|
Loading…
Reference in a new issue