Add support for @me in GuildMemberNickname (#319)
This commit is contained in:
parent
b07d1c4621
commit
383bdad7dd
1 changed files with 5 additions and 0 deletions
|
@ -776,12 +776,17 @@ func (s *Session) GuildMemberMove(guildID, userID, channelID string) (err error)
|
|||
// GuildMemberNickname updates the nickname of a guild member
|
||||
// guildID : The ID of a guild
|
||||
// userID : The ID of a user
|
||||
// userID : The ID of a user or "@me" which is a shortcut of the current user ID
|
||||
func (s *Session) GuildMemberNickname(guildID, userID, nickname string) (err error) {
|
||||
|
||||
data := struct {
|
||||
Nick string `json:"nick"`
|
||||
}{nickname}
|
||||
|
||||
if userID == "@me" {
|
||||
userID += "/nick"
|
||||
}
|
||||
|
||||
_, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, ""))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue