Update GuildRoleEdit
This commit is contained in:
parent
ef3cd76e3d
commit
1ab71f4b12
1 changed files with 7 additions and 5 deletions
12
restapi.go
12
restapi.go
|
@ -797,7 +797,8 @@ func (s *Session) GuildRoleCreate(guildID string) (st *Role, err error) {
|
||||||
// color : The color of the role (decimal, not hex).
|
// color : The color of the role (decimal, not hex).
|
||||||
// hoist : Whether to display the role's users separately.
|
// hoist : Whether to display the role's users separately.
|
||||||
// perm : The permissions for the role.
|
// perm : The permissions for the role.
|
||||||
func (s *Session) GuildRoleEdit(guildID, roleID, name string, color int, hoist bool, perm int) (st *Role, err error) {
|
// mention : Whether this role is mentionable
|
||||||
|
func (s *Session) GuildRoleEdit(guildID, roleID, name string, color int, hoist bool, perm int, mention bool) (st *Role, err error) {
|
||||||
|
|
||||||
// Prevent sending a color int that is too big.
|
// Prevent sending a color int that is too big.
|
||||||
if color > 0xFFFFFF {
|
if color > 0xFFFFFF {
|
||||||
|
@ -805,11 +806,12 @@ func (s *Session) GuildRoleEdit(guildID, roleID, name string, color int, hoist b
|
||||||
}
|
}
|
||||||
|
|
||||||
data := struct {
|
data := struct {
|
||||||
Name string `json:"name"` // The color the role should have (as a decimal, not hex)
|
Name string `json:"name"` // The role's name (overwrites existing)
|
||||||
Color int `json:"color"` // Whether to display the role's users separately
|
Color int `json:"color"` // The color the role should have (as a decimal, not hex)
|
||||||
Hoist bool `json:"hoist"` // The role's name (overwrites existing)
|
Hoist bool `json:"hoist"` // Whether to display the role's users separately
|
||||||
Permissions int `json:"permissions"` // The overall permissions number of the role (overwrites existing)
|
Permissions int `json:"permissions"` // The overall permissions number of the role (overwrites existing)
|
||||||
}{name, color, hoist, perm}
|
Mentionable bool `json:"mentionable"` // Whether this role is mentionable
|
||||||
|
}{name, color, hoist, perm, mention}
|
||||||
|
|
||||||
body, err := s.Request("PATCH", EndpointGuildRole(guildID, roleID), data)
|
body, err := s.Request("PATCH", EndpointGuildRole(guildID, roleID), data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue