From ecc04182719033eebe8cad960165f5a12e540e84 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Fri, 23 Apr 2021 23:27:35 +0200 Subject: [PATCH] Update get_channel_webhooks.ts --- src/helpers/channels/get_channel_webhooks.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/helpers/channels/get_channel_webhooks.ts b/src/helpers/channels/get_channel_webhooks.ts index bdea2baf5..69fcc7825 100644 --- a/src/helpers/channels/get_channel_webhooks.ts +++ b/src/helpers/channels/get_channel_webhooks.ts @@ -1,23 +1,19 @@ import { rest } from "../../rest/rest.ts"; -import { DiscordWebhook, Webhook } from "../../types/webhooks/webhook.ts"; +import { Webhook } from "../../types/webhooks/webhook.ts"; import { Collection } from "../../util/collection.ts"; import { endpoints } from "../../util/constants.ts"; import { requireBotChannelPermissions } from "../../util/permissions.ts"; -import { snakeKeysToCamelCase } from "../../util/utils.ts"; /** Gets the webhooks for this channel. Requires MANAGE_WEBHOOKS */ export async function getChannelWebhooks(channelId: string) { await requireBotChannelPermissions(channelId, ["MANAGE_WEBHOOKS"]); - const result = (await rest.runMethod( + const result = await rest.runMethod( "get", endpoints.CHANNEL_WEBHOOKS(channelId), - )) as DiscordWebhook[]; + ); return new Collection( - result.map((webhook) => [ - webhook.id, - snakeKeysToCamelCase(webhook), - ]), + result.map((webhook) => [webhook.id, webhook]), ); }