mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 01:10:07 +00:00
* feat: base plugin lib idea * fix: stuff * fmt * fix: imports and exports * fix: errors & tests * fix: remove logs
16 lines
421 B
TypeScript
16 lines
421 B
TypeScript
import { Bot } from "../../bot.ts";
|
|
import { DiscordWebhook } from "../../deps.ts";
|
|
|
|
/** Returns the new webhook object for the given id. */
|
|
export async function getWebhook(bot: Bot, webhookId: bigint) {
|
|
const result = await bot.rest.runMethod<DiscordWebhook>(
|
|
bot.rest,
|
|
"GET",
|
|
bot.constants.routes.WEBHOOK_ID(webhookId),
|
|
);
|
|
|
|
if (!result?.id) return;
|
|
|
|
return bot.transformers.webhook(bot, result);
|
|
}
|