mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
14 lines
520 B
TypeScript
14 lines
520 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
import { DiscordWebhook } from "../../types/discord.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<DiscordWebhook>(
|
|
bot.rest,
|
|
"GET",
|
|
bot.constants.routes.WEBHOOK(webhookId, token),
|
|
);
|
|
|
|
return bot.transformers.webhook(bot, result);
|
|
}
|