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