From f06705952695c86badb9f064883529a6f9ee011f Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Fri, 26 Jun 2020 15:32:53 -0700 Subject: [PATCH 1/3] Update Emoji struct --- structs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/structs.go b/structs.go index d46a992..33c5862 100644 --- a/structs.go +++ b/structs.go @@ -330,8 +330,8 @@ type Emoji struct { Name string `json:"name"` Roles []string `json:"roles"` User *User `json:"user"` - Managed bool `json:"managed"` RequireColons bool `json:"require_colons"` + Managed bool `json:"managed"` Animated bool `json:"animated"` Available bool `json:"available"` } From f193d81d838b57248090210abb99c1bd6436be7c Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Fri, 26 Jun 2020 15:35:57 -0700 Subject: [PATCH 2/3] Add GuildEmoji function --- restapi.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/restapi.go b/restapi.go index db57364..4b87451 100644 --- a/restapi.go +++ b/restapi.go @@ -1309,6 +1309,19 @@ func (s *Session) GuildAuditLog(guildID, userID, beforeID string, actionType, li return } +// GuildEmoji returns all emoji +// guildID : The ID of a Guild. +func (s *Session) GuildEmoji(guildID string) (emoji []*Emoji, err error) { + + body, err := s.RequestWithBucketID("GET", EndpointGuildEmojis(guildID), nil, EndpointGuildEmojis(guildID)) + if err != nil { + return + } + + err = unmarshal(body, &emoji) + return +} + // GuildEmojiCreate creates a new emoji // guildID : The ID of a Guild. // name : The Name of the Emoji. From 4738844e3447ee3ed535191104145645c5d91dea Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Sun, 28 Jun 2020 16:02:02 -0700 Subject: [PATCH 3/3] Rename GuildEmoji to GuildEmojis --- restapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/restapi.go b/restapi.go index 4b87451..69b7ceb 100644 --- a/restapi.go +++ b/restapi.go @@ -1309,9 +1309,9 @@ func (s *Session) GuildAuditLog(guildID, userID, beforeID string, actionType, li return } -// GuildEmoji returns all emoji +// GuildEmojis returns all emoji // guildID : The ID of a Guild. -func (s *Session) GuildEmoji(guildID string) (emoji []*Emoji, err error) { +func (s *Session) GuildEmojis(guildID string) (emoji []*Emoji, err error) { body, err := s.RequestWithBucketID("GET", EndpointGuildEmojis(guildID), nil, EndpointGuildEmojis(guildID)) if err != nil {