// Helpers that normalize Discord-like values into Kimaki platform transport types.
// Used when callers already have message/thread objects and need platform-shaped
// data without importing discord.js outside adapter boundaries.
export function platformMessageFromDiscord(message) {
    return {
        id: message.id,
        content: message.content,
        channelId: message.channelId,
        author: {
            id: message.author.id,
            username: message.author.username,
            displayName: message.member?.displayName || message.author.displayName || message.author.username,
            globalName: message.author.displayName || undefined,
            bot: message.author.bot,
        },
        attachments: message.attachments,
        embeds: message.embeds.map((embed) => {
            return {
                data: {
                    footer: {
                        text: embed.footer?.text,
                    },
                },
            };
        }),
    };
}
export function platformThreadFromDiscord(thread) {
    return {
        id: thread.id,
        name: thread.name,
        kind: 'thread',
        type: 'thread',
        parentId: thread.parentId,
        guildId: thread.guildId,
        createdTimestamp: thread.createdTimestamp ?? null,
        isThread() {
            return true;
        },
    };
}
