my_custom_code.go 621 B

123456789101112131415161718192021
  1. package discordgo
  2. // GuildMemberEditCustom updates a members roles and nick
  3. // guildID : The ID of a Guild.
  4. // userID : The ID of a User.
  5. // nick : The new nickname to set on the
  6. // roles : A list of role ID's to set on the member.
  7. func (s *Session) GuildMemberEditCustom(guildID, userID, nick string, roles []string) (err error) {
  8. data := struct {
  9. Nick string `json:"nick,omitempty"`
  10. Roles []string `json:"roles,omitempty"`
  11. }{nick, roles}
  12. _, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, ""))
  13. if err != nil {
  14. return
  15. }
  16. return
  17. }