diff --git a/src/helpers/webhooks/create_webhook.ts b/src/helpers/webhooks/create_webhook.ts index bd771596f..bd7701525 100644 --- a/src/helpers/webhooks/create_webhook.ts +++ b/src/helpers/webhooks/create_webhook.ts @@ -1,8 +1,10 @@ import { rest } from "../../rest/rest.ts"; import { Errors } from "../../types/misc/errors.ts"; +import { CreateWebhook } from "../../types/webhooks/create_webhook.ts"; +import { Webhook } from "../../types/webhooks/webhook.ts"; import { endpoints } from "../../util/constants.ts"; import { requireBotChannelPermissions } from "../../util/permissions.ts"; -import { urlToBase64 } from "../../util/utils.ts"; +import { snakeKeysToCamelCase, urlToBase64 } from "../../util/utils.ts"; /** * Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations: @@ -11,7 +13,7 @@ import { urlToBase64 } from "../../util/utils.ts"; */ export async function createWebhook( channelId: string, - options: WebhookCreateOptions, + options: CreateWebhook, ) { await requireBotChannelPermissions(channelId, ["MANAGE_WEBHOOKS"]); @@ -34,5 +36,5 @@ export async function createWebhook( }, ); - return result as WebhookPayload; + return snakeKeysToCamelCase(result); }