discordgo
discordgo copied to clipboard
the function ChannelEditComplex does not respect omitting Position
The struct (ChannelEdit) in structs.go does not have an "omitempty" tag after Position resulting in it changing the channel position if you do not specify.
type ChannelEdit struct {
Name string `json:"name,omitempty"`
Topic string `json:"topic,omitempty"`
NSFW bool `json:"nsfw,omitempty"`
Position int `json:"position"` // here (Should be `json:"position,omitempty"`)
Bitrate int `json:"bitrate,omitempty"`
UserLimit int `json:"user_limit,omitempty"`
PermissionOverwrites []*PermissionOverwrite `json:"permission_overwrites,omitempty"`
ParentID string `json:"parent_id,omitempty"`
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
}
Unfortunately adding omitempty
will prevent moving a channel to the top (position 0). Related #808.