Explorar o código

fix: add missing `(*Guild).BannerURL()` method (#1023)

Signed-off-by: AKP <tom@tdpain.net>
AKU %!s(int64=3) %!d(string=hai) anos
pai
achega
007bf76790
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      structs.go

+ 8 - 0
structs.go

@@ -645,6 +645,14 @@ func (g *Guild) IconURL() string {
 	return EndpointGuildIcon(g.ID, g.Icon)
 }
 
+// BannerURL returns a URL to the guild's banner.
+func (g *Guild) BannerURL() string {
+	if g.Banner == "" {
+		return ""
+	}
+	return EndpointGuildBanner(g.ID, g.Banner)
+}
+
 // A UserGuild holds a brief version of a Guild
 type UserGuild struct {
 	ID          string `json:"id"`