mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
14 lines
472 B
TypeScript
14 lines
472 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
import { DiscordGuildWidgetSettings } from "../../types/discord.ts";
|
|
|
|
/** Returns a guild widget settings object. Requires the MANAGE_GUILD permission. */
|
|
export async function getWidgetSettings(bot: Bot, guildId: bigint) {
|
|
const result = await bot.rest.runMethod<DiscordGuildWidgetSettings>(
|
|
bot.rest,
|
|
"GET",
|
|
bot.constants.routes.GUILD_WIDGET(guildId),
|
|
);
|
|
|
|
return bot.transformers.widgetSettings(bot, result);
|
|
}
|