From ddfae07d0a9cdfd0432bdfaf91a11c644cd7f78a Mon Sep 17 00:00:00 2001 From: BasiliskHill Date: Fri, 8 Sep 2023 09:13:12 +1000 Subject: [PATCH] Add string tag to Role Permissions (#21) The JSON package is having difficulties unmarshalling permissions due to them being presented by the API as a string without a string tag being present to note to the package that changes need to be made while marshalling/unmarshalling. Hence, the string tag is added under the Role object --- api/permissions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/permissions.go b/api/permissions.go index b25f508..a36b664 100644 --- a/api/permissions.go +++ b/api/permissions.go @@ -715,7 +715,7 @@ type Role struct { Icon *string `json:"icon,omitempty"` // role icon hash UnicodeEmoji *string `json:"unicode_emoji,omitempty"` // role unicode emoji Position int `json:"position"` // position of this role - Permissions Permission `json:"permissions"` // permission bit set + Permissions Permission `json:"permissions,string"` // permission bit set Managed bool `json:"managed"` // whether this role is managed by an integration Mentionable bool `json:"mentionable"` // whether this role is mentionable Tags RoleTags `json:"tags,omitempty"` // the tags this role has