mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
14 lines
401 B
TypeScript
14 lines
401 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
import { DiscordGuildWidget } from "../../types/discord.ts";
|
|
|
|
/** Returns the widget for the guild. */
|
|
export async function getWidget(bot: Bot, guildId: bigint) {
|
|
const result = await bot.rest.runMethod<DiscordGuildWidget>(
|
|
bot.rest,
|
|
"GET",
|
|
bot.constants.routes.GUILD_WIDGET_JSON(guildId),
|
|
);
|
|
|
|
return bot.transformers.widget(bot, result);
|
|
}
|