From 007bf767904825eb3d881daa136698771d3ee0cb Mon Sep 17 00:00:00 2001 From: AKU Date: Thu, 28 Oct 2021 00:56:26 +0100 Subject: [PATCH] fix: add missing `(*Guild).BannerURL()` method (#1023) Signed-off-by: AKP --- structs.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/structs.go b/structs.go index 5688cac..b4baa6b 100644 --- a/structs.go +++ b/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"`