Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit ce1b695

Browse files
author
jonas747
committed
update some rest api endpoints to v9
1 parent 805c9c4 commit ce1b695

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

restapi.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ func (s *Session) GuildRoleCreateComplex(guildID int64, roleCreate RoleCreate) (
11571157
// hoist : Whether to display the role's users separately.
11581158
// perm : The permissions for the role.
11591159
// mention : Whether this role is mentionable
1160-
func (s *Session) GuildRoleEdit(guildID, roleID int64, name string, color int, hoist bool, perm int, mention bool) (st *Role, err error) {
1160+
func (s *Session) GuildRoleEdit(guildID, roleID int64, name string, color int, hoist bool, perm int64, mention bool) (st *Role, err error) {
11611161

11621162
// Prevent sending a color int that is too big.
11631163
if color > 0xFFFFFF {
@@ -1166,11 +1166,11 @@ func (s *Session) GuildRoleEdit(guildID, roleID int64, name string, color int, h
11661166
}
11671167

11681168
data := struct {
1169-
Name string `json:"name"` // The role's name (overwrites existing)
1170-
Color int `json:"color"` // The color the role should have (as a decimal, not hex)
1171-
Hoist bool `json:"hoist"` // Whether to display the role's users separately
1172-
Permissions int `json:"permissions"` // The overall permissions number of the role (overwrites existing)
1173-
Mentionable bool `json:"mentionable"` // Whether this role is mentionable
1169+
Name string `json:"name"` // The role's name (overwrites existing)
1170+
Color int `json:"color"` // The color the role should have (as a decimal, not hex)
1171+
Hoist bool `json:"hoist"` // Whether to display the role's users separately
1172+
Permissions int64 `json:"permissions,string"` // The overall permissions number of the role (overwrites existing)
1173+
Mentionable bool `json:"mentionable"` // Whether this role is mentionable
11741174
}{name, color, hoist, perm, mention}
11751175

11761176
body, err := s.RequestWithBucketID("PATCH", EndpointGuildRole(guildID, roleID), data, EndpointGuildRole(guildID, 0))
@@ -1893,13 +1893,13 @@ func (s *Session) ChannelInviteCreate(channelID int64, i Invite) (st *Invite, er
18931893
// ChannelPermissionSet creates a Permission Override for the given channel.
18941894
// NOTE: This func name may changed. Using Set instead of Create because
18951895
// you can both create a new override or update an override with this function.
1896-
func (s *Session) ChannelPermissionSet(channelID, targetID int64, targetType string, allow, deny int) (err error) {
1896+
func (s *Session) ChannelPermissionSet(channelID, targetID int64, targetType PermissionOverwriteType, allow, deny int64) (err error) {
18971897

18981898
data := struct {
1899-
ID int64 `json:"id,string"`
1900-
Type string `json:"type"`
1901-
Allow int `json:"allow"`
1902-
Deny int `json:"deny"`
1899+
ID int64 `json:"id,string"`
1900+
Type PermissionOverwriteType `json:"type,string"`
1901+
Allow int64 `json:"allow"`
1902+
Deny int64 `json:"deny"`
19031903
}{targetID, targetType, allow, deny}
19041904

19051905
_, err = s.RequestWithBucketID("PUT", EndpointChannelPermission(channelID, targetID), data, EndpointChannelPermission(channelID, 0))

0 commit comments

Comments
 (0)