1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-12-01 11:12:48 +00:00

API: Changed ModifyChannel to match other Modify channels

This commit is contained in:
diamondburned (Forefront) 2020-04-08 17:57:44 -07:00
parent bd32b19645
commit d5a3a0bd45

View file

@ -74,8 +74,6 @@ func (c *Client) Channel(
}
type ModifyChannelData struct {
ChannelID discord.Snowflake `json:"id,string,omitempty"`
// All types
Name string `json:"name,omitempty"`
Position json.OptionInt `json:"position,omitempty"`
@ -98,11 +96,12 @@ type ModifyChannelData struct {
CategoryID discord.Snowflake `json:"parent_id,string,omitempty"`
}
func (c *Client) ModifyChannel(data ModifyChannelData) error {
url := EndpointChannels + data.ChannelID.String()
data.ChannelID = 0
return c.FastRequest("PATCH", url, httputil.WithJSONBody(c, data))
func (c *Client) ModifyChannel(channelID discord.Snowflake, data ModifyChannelData) error {
return c.FastRequest(
"PATCH",
EndpointChannels+channelID.String(),
httputil.WithJSONBody(c, data),
)
}
func (c *Client) DeleteChannel(channelID discord.Snowflake) error {