Modify GuildEmojiEdit function of restapi.go (#1022)
* Modify GuildEmojiEdit function of restapi.go Changes function to not omit empty role information. This allows for properly resetting the roles of an emoji, otherwise it appears to be presently impossible to reset the roles (without including a role ID in the edit request). * feat: code review changes * feat: fix typo and rephrase Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
This commit is contained in:
parent
8a126aa174
commit
24828068bc
1 changed files with 2 additions and 2 deletions
|
@ -1378,12 +1378,12 @@ func (s *Session) GuildEmojiCreate(guildID, name, image string, roles []string)
|
|||
// guildID : The ID of a Guild.
|
||||
// emojiID : The ID of an Emoji.
|
||||
// name : The Name of the Emoji.
|
||||
// roles : The roles for which this emoji will be whitelisted, can be nil.
|
||||
// roles : The roles for which this emoji will be whitelisted, if nil or empty the roles will be reset.
|
||||
func (s *Session) GuildEmojiEdit(guildID, emojiID, name string, roles []string) (emoji *Emoji, err error) {
|
||||
|
||||
data := struct {
|
||||
Name string `json:"name"`
|
||||
Roles []string `json:"roles,omitempty"`
|
||||
Roles []string `json:"roles"`
|
||||
}{name, roles}
|
||||
|
||||
body, err := s.RequestWithBucketID("PATCH", EndpointGuildEmoji(guildID, emojiID), data, EndpointGuildEmojis(guildID))
|
||||
|
|
Loading…
Reference in a new issue