import { sendMessage } from "../lib/telegram.js";
export async function message(params) {
    const botToken = process.env.TELEGRAM_BOT_TOKEN;
    if (!botToken) {
        return {
            sent: false,
            channel: params.channel,
            error: "TELEGRAM_BOT_TOKEN not configured — no bot token passed to this MCP server",
        };
    }
    let replyMarkup;
    if (params.inlineKeyboard) {
        replyMarkup = {
            inline_keyboard: params.inlineKeyboard.map((row) => row.map((btn) => ({
                text: btn.text,
                callback_data: btn.callbackData,
                url: btn.url,
            }))),
        };
    }
    const result = await sendMessage(botToken, {
        chatId: params.chatId,
        text: params.text,
        parseMode: params.parseMode,
        replyMarkup,
    });
    return {
        sent: result.ok,
        channel: "telegram",
        messageId: result.messageId,
        error: result.error,
    };
}
//# sourceMappingURL=message.js.map