Skip to content

Commit

Permalink
Add IconURL and BannerURL to OAuth2Guild (#370)
Browse files Browse the repository at this point in the history
* Add Banner to OAuth2Guild

* Add IconURL and BannerURL to OAuth2Guild
  • Loading branch information
Sebastian authored Jul 18, 2024
1 parent b9c16e9 commit a973fd9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions discord/guild.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,22 @@ type OAuth2Guild struct {
ApproximatePresenceCount int `json:"approximate_presence_count"`
}

func (g OAuth2Guild) IconURL(opts ...CDNOpt) *string {
if g.Icon == nil {
return nil
}
url := formatAssetURL(GuildIcon, opts, g.ID, *g.Icon)
return &url
}

func (g OAuth2Guild) BannerURL(opts ...CDNOpt) *string {
if g.Banner == nil {
return nil
}
url := formatAssetURL(GuildBanner, opts, g.ID, *g.Banner)
return &url
}

// GuildWelcomeScreen is the Welcome Screen of a Guild
type GuildWelcomeScreen struct {
Description *string `json:"description,omitempty"`
Expand Down

0 comments on commit a973fd9

Please sign in to comment.