mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 08:20:08 +00:00
* add guild widget settings interface, transformer * fix bot.transformers.widgetSettings is not a function Co-authored-by: ITOH <to@itoh.at>
15 lines
483 B
TypeScript
15 lines
483 B
TypeScript
import { Bot } from "../bot.ts";
|
|
import { DiscordGuildWidgetSettings } from "../types/discord.ts";
|
|
import { Optionalize } from "../types/shared.ts";
|
|
|
|
export function transformWidgetSettings(bot: Bot, payload: DiscordGuildWidgetSettings) {
|
|
const widget = {
|
|
enabled: payload.enabled,
|
|
channelId: payload.channel_id ?? undefined,
|
|
};
|
|
|
|
return widget as Optionalize<typeof widget>;
|
|
}
|
|
|
|
export interface GuildWidgetSettings extends ReturnType<typeof transformWidgetSettings> {}
|