mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
fix: webhook typings
This commit is contained in:
@@ -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<Webhook>(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user