From ef3cd76e3dc4583b06f5f2b8e896643c44280c51 Mon Sep 17 00:00:00 2001 From: soft as HELL Date: Sun, 11 Sep 2016 14:32:41 +0300 Subject: [PATCH 1/2] Add mentionable to Role struct --- structs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/structs.go b/structs.go index b782432..7fcf44b 100644 --- a/structs.go +++ b/structs.go @@ -232,6 +232,7 @@ type Role struct { ID string `json:"id"` Name string `json:"name"` Managed bool `json:"managed"` + Mentionable bool `json:"mentionable"` Hoist bool `json:"hoist"` Color int `json:"color"` Position int `json:"position"` From 1ab71f4b12c933980fc1287ac292ef04922e1a5e Mon Sep 17 00:00:00 2001 From: soft as HELL Date: Sun, 11 Sep 2016 14:32:58 +0300 Subject: [PATCH 2/2] Update GuildRoleEdit --- restapi.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/restapi.go b/restapi.go index 5df9c32..1f61cbb 100644 --- a/restapi.go +++ b/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). // hoist : Whether to display the role's users separately. // 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. if color > 0xFFFFFF { @@ -805,11 +806,12 @@ func (s *Session) GuildRoleEdit(guildID, roleID, name string, color int, hoist b } data := struct { - Name string `json:"name"` // The color the role should have (as a decimal, not hex) - Color int `json:"color"` // Whether to display the role's users separately - Hoist bool `json:"hoist"` // The role's name (overwrites existing) + Name string `json:"name"` // The role's name (overwrites existing) + Color int `json:"color"` // The color the role should have (as a decimal, not hex) + 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) - }{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) if err != nil {