mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
* feat: base plugin lib idea * fix: stuff * fmt * fix: imports and exports * fix: errors & tests * fix: remove logs
14 lines
437 B
TypeScript
14 lines
437 B
TypeScript
import { Bot } from "../bot.ts";
|
|
import { DiscordGuildWidgetSettings, Optionalize } from "../deps.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> {}
|