mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-30 15:30:07 +00:00
18 lines
562 B
TypeScript
18 lines
562 B
TypeScript
import { Bot } from "../bot.ts";
|
|
import { GuildWidget } from "../types/guilds/guildWidget.ts";
|
|
import { SnakeCasedPropertiesDeep } from "../types/util.ts";
|
|
|
|
export function transformWidget(bot: Bot, payload: SnakeCasedPropertiesDeep<GuildWidget>): DiscordenoWidget {
|
|
return {
|
|
channelId: payload.channel_id ? bot.transformers.snowflake(payload.channel_id) : undefined,
|
|
enabled: payload.enabled,
|
|
};
|
|
}
|
|
|
|
export interface DiscordenoWidget {
|
|
/** Whether the widget is enabled */
|
|
enabled: boolean;
|
|
/** The widget channel id */
|
|
channelId?: bigint;
|
|
}
|