From c4352ea83f3f6ddfcc4d70ab1d39e6c61b1e0eb0 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Mon, 12 Apr 2021 18:27:12 +0000 Subject: [PATCH] fix: webhook typings --- src/helpers/webhooks/create_webhook.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); }