From 6baccde3a9007eb0cbd260a3114704a17f2b5e1f Mon Sep 17 00:00:00 2001 From: ayntee Date: Sun, 22 Nov 2020 19:36:38 +0400 Subject: [PATCH] Types for getChannelWebhooks() Closes #207 --- src/handlers/channel.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/handlers/channel.ts b/src/handlers/channel.ts index 83f269916..2c5a1f219 100644 --- a/src/handlers/channel.ts +++ b/src/handlers/channel.ts @@ -16,6 +16,7 @@ import { Errors } from "../types/errors.ts"; import { RawOverwrite } from "../types/guild.ts"; import { MessageCreateOptions } from "../types/message.ts"; import { Permission, Permissions } from "../types/permission.ts"; +import { WebhookPayload } from "../types/webhook.ts"; import { endpoints } from "../utils/constants.ts"; import { botHasChannelPermissions } from "../utils/permissions.ts"; @@ -298,7 +299,9 @@ export async function getChannelWebhooks(channelID: string) { ) { throw new Error(Errors.MISSING_MANAGE_WEBHOOKS); } - return RequestManager.get(endpoints.CHANNEL_WEBHOOKS(channelID)); + return RequestManager.get(endpoints.CHANNEL_WEBHOOKS(channelID)) as Promise< + WebhookPayload[] + >; } interface EditChannelRequest {