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

10 lines
429 B
TypeScript

import type { GuildWidget } from "../../types/guilds/guildWidget.ts";
import type { Bot } from "../../bot.ts";
/** Returns the guild widget object. Requires the MANAGE_GUILD permission. */
export async function getWidgetSettings(bot: Bot, guildId: bigint) {
const result = await bot.rest.runMethod<GuildWidget>(bot.rest, "get", bot.constants.endpoints.GUILD_WIDGET(guildId));
return bot.transformers.widget(bot, result);
}