Files
discordeno/helpers/webhooks/getWebhookWithToken.ts
2022-02-11 09:49:53 +00:00

10 lines
506 B
TypeScript

import type { Webhook } from "../../types/webhooks/webhook.ts";
import type { Bot } from "../../bot.ts";
/** Returns the new webhook object for the given id, this call does not require authentication and returns no user in the webhook object. */
export async function getWebhookWithToken(bot: Bot, webhookId: bigint, token: string) {
const result = await bot.rest.runMethod<Webhook>(bot.rest, "get", bot.constants.endpoints.WEBHOOK(webhookId, token));
return bot.transformers.webhook(bot, result);
}