diff --git a/api/webhook.go b/api/webhook.go index 50e0af8..9924cf3 100644 --- a/api/webhook.go +++ b/api/webhook.go @@ -22,22 +22,13 @@ type CreateWebhookData struct { // // Requires the MANAGE_WEBHOOKS permission. func (c *Client) CreateWebhook( - channelID discord.Snowflake, - name string, avatar discord.Hash) (*discord.Webhook, error) { - - var param struct { - Name string `json:"name"` - Avatar discord.Hash `json:"avatar"` - } - - param.Name = name - param.Avatar = avatar + channelID discord.Snowflake, data CreateWebhookData) (*discord.Webhook, error) { var w *discord.Webhook return w, c.RequestJSON( &w, "POST", EndpointChannels+channelID.String()+"/webhooks", - httputil.WithJSONBody(param), + httputil.WithJSONBody(data), ) }