mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-11-27 22:56:13 +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)
|
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
|
// https://discord.com/developers/docs/resources/guild#guild-preview-object
|
||||||
type GuildPreview struct {
|
type GuildPreview struct {
|
||||||
// ID is the guild id.
|
// ID is the guild id.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue