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:
parent
bd32b19645
commit
d5a3a0bd45
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue