@robinpath/telegram
Advanced tools
| import type { ModuleAdapter } from "@robinpath/core"; | ||
| declare const TelegramModule: ModuleAdapter; | ||
| export default TelegramModule; | ||
| export { TelegramModule }; | ||
| export { TelegramFunctions, TelegramFunctionMetadata, TelegramModuleMetadata, TelegramCredentialTypes, } from "./telegram.js"; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD,QAAA,MAAM,cAAc,EAAE,aAQrB,CAAC;AAEF,eAAe,cAAc,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,eAAe,CAAC"} |
| import { TelegramFunctions, TelegramFunctionMetadata, TelegramModuleMetadata, TelegramCredentialTypes, configureTelegram, } from "./telegram.js"; | ||
| const TelegramModule = { | ||
| name: "telegram", | ||
| functions: TelegramFunctions, | ||
| functionMetadata: TelegramFunctionMetadata, | ||
| moduleMetadata: TelegramModuleMetadata, | ||
| credentialTypes: TelegramCredentialTypes, | ||
| configure: configureTelegram, | ||
| global: false, | ||
| }; | ||
| export default TelegramModule; | ||
| export { TelegramModule }; | ||
| export { TelegramFunctions, TelegramFunctionMetadata, TelegramModuleMetadata, TelegramCredentialTypes, } from "./telegram.js"; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,MAAM,cAAc,GAAkB;IACpC,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,iBAAiB;IAC5B,gBAAgB,EAAE,wBAAwB;IAC1C,cAAc,EAAE,sBAAsB;IACtC,eAAe,EAAE,uBAAuB;IACxC,SAAS,EAAE,iBAAiB;IAC5B,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,eAAe,cAAc,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,eAAe,CAAC"} |
| /** | ||
| * RobinPath Telegram Module (Node port) | ||
| * | ||
| * Telegram Bot API integration. Mirror of packages/php/telegram/src/index.php | ||
| * for the WordPress plugin; shares the same credential contract, metadata | ||
| * shape, and error taxonomy so the visual editor can render both identically. | ||
| * | ||
| * Authentication uses the RobinPath credential vault. Every handler takes a | ||
| * credential slug as its first argument; the module resolves the stored bot | ||
| * token (`123456789:ABC-DEF…`) at call time and splices it into the request | ||
| * URL path — `https://api.telegram.org/bot{TOKEN}/{method}` — as the | ||
| * Telegram API mandates. The token never reaches HTTP headers and is | ||
| * scrubbed from log lines because the URL is kept out of the response | ||
| * envelope. | ||
| * | ||
| * Credential type declared by this module: | ||
| * - telegram_bot_token : { token } → appended to api.telegram.org URL | ||
| */ | ||
| import type { BuiltinHandler, CredentialTypeSchema, FunctionMetadata, ModuleHost, ModuleMetadata } from "@robinpath/core"; | ||
| export declare function configureTelegram(h: ModuleHost): void; | ||
| export declare const TelegramFunctions: Record<string, BuiltinHandler>; | ||
| export declare const TelegramCredentialTypes: CredentialTypeSchema[]; | ||
| export declare const TelegramFunctionMetadata: Record<string, FunctionMetadata>; | ||
| export declare const TelegramModuleMetadata: ModuleMetadata; | ||
| //# sourceMappingURL=telegram.d.ts.map |
| {"version":3,"file":"telegram.d.ts","sourceRoot":"","sources":["../src/telegram.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAiBzB,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAErD;AAurBD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAa5D,CAAC;AAIF,eAAO,MAAM,uBAAuB,EAAE,oBAAoB,EAkBzD,CAAC;AAmGF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA0iBrE,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,cA4CpC,CAAC"} |
+1252
| /** | ||
| * RobinPath Telegram Module (Node port) | ||
| * | ||
| * Telegram Bot API integration. Mirror of packages/php/telegram/src/index.php | ||
| * for the WordPress plugin; shares the same credential contract, metadata | ||
| * shape, and error taxonomy so the visual editor can render both identically. | ||
| * | ||
| * Authentication uses the RobinPath credential vault. Every handler takes a | ||
| * credential slug as its first argument; the module resolves the stored bot | ||
| * token (`123456789:ABC-DEF…`) at call time and splices it into the request | ||
| * URL path — `https://api.telegram.org/bot{TOKEN}/{method}` — as the | ||
| * Telegram API mandates. The token never reaches HTTP headers and is | ||
| * scrubbed from log lines because the URL is kept out of the response | ||
| * envelope. | ||
| * | ||
| * Credential type declared by this module: | ||
| * - telegram_bot_token : { token } → appended to api.telegram.org URL | ||
| */ | ||
| import { readFileSync, existsSync } from "node:fs"; | ||
| import { basename } from "node:path"; | ||
| // ── Module-local state (populated by configure hook) ──────────────────── | ||
| const state = {}; | ||
| function host() { | ||
| if (!state.host) { | ||
| throw new Error("Telegram module not initialized. Pass the adapter to rp.registerModule() via loadModule so its configure() hook runs first."); | ||
| } | ||
| return state.host; | ||
| } | ||
| export function configureTelegram(h) { | ||
| state.host = h; | ||
| } | ||
| // ── Constants ────────────────────────────────────────────────────────── | ||
| const API_BASE = "https://api.telegram.org/bot"; | ||
| const CREDENTIAL_TYPE = "telegram_bot_token"; | ||
| function errorReturn(error, code, extra = {}) { | ||
| return { error, code, ...extra }; | ||
| } | ||
| // ── Credential resolver ──────────────────────────────────────────────── | ||
| async function resolveToken(credentialSlug) { | ||
| if (!credentialSlug) { | ||
| return errorReturn("Credential slug is required.", "credential_not_found"); | ||
| } | ||
| let fields; | ||
| try { | ||
| fields = await host().credentials.get(credentialSlug); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "credential_not_found"); | ||
| } | ||
| if (!fields) { | ||
| return errorReturn(`Credential '${credentialSlug}' not found.`, "credential_not_found"); | ||
| } | ||
| const token = String(fields.token ?? ""); | ||
| if (!token) { | ||
| return errorReturn(`Credential '${credentialSlug}' has no \`token\` field.`, "token_missing"); | ||
| } | ||
| return { token }; | ||
| } | ||
| // ── HTTP helpers ─────────────────────────────────────────────────────── | ||
| /** | ||
| * POST application/json to the Telegram Bot API and normalize the response. | ||
| * | ||
| * Token is spliced into the URL: `https://api.telegram.org/bot{TOKEN}/{method}`. | ||
| * | ||
| * Success: returns the parsed `result` field (as an array/object), or — for | ||
| * bool/scalar results — an `{ ok: true, result }` envelope so the caller | ||
| * always gets an object. | ||
| * | ||
| * Failure: returns `{error, code, telegram_error, description, status, error_code?, parameters?}`. | ||
| * Never throws. | ||
| */ | ||
| async function http(token, method, body) { | ||
| const url = `${API_BASE}${token}/${method}`; | ||
| let response; | ||
| try { | ||
| response = await fetch(url, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json; charset=utf-8" }, | ||
| body: JSON.stringify(body ?? {}), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const status = response.status; | ||
| const raw = await response.text(); | ||
| let decoded; | ||
| try { | ||
| decoded = raw ? JSON.parse(raw) : null; | ||
| } | ||
| catch { | ||
| decoded = null; | ||
| } | ||
| if (!decoded || typeof decoded !== "object") { | ||
| return errorReturn(`Telegram returned non-JSON for ${method}: ${raw.slice(0, 200)}`, "transport", { status }); | ||
| } | ||
| const d = decoded; | ||
| if (!d.ok) { | ||
| const description = String(d.description ?? "unknown_error"); | ||
| const code = status === 429 ? "rate_limited" : "telegram_error"; | ||
| return errorReturn(`Telegram ${method} failed: ${description}`, code, { | ||
| status, | ||
| telegram_error: description, | ||
| description, | ||
| error_code: Number(d.error_code ?? 0), | ||
| parameters: d.parameters && typeof d.parameters === "object" ? d.parameters : null, | ||
| }); | ||
| } | ||
| const result = d.result; | ||
| if (result && typeof result === "object") { | ||
| return result; | ||
| } | ||
| // Bool/string/int result (e.g. deleteMessage → true) — wrap so the caller still gets an object. | ||
| return { ok: true, result }; | ||
| } | ||
| /** | ||
| * Multipart POST for file uploads (photo/document/sticker). Uses WHATWG | ||
| * `FormData` + `Blob` to assemble the body so fetch handles the boundary. | ||
| */ | ||
| async function httpMultipart(token, method, parts) { | ||
| const url = `${API_BASE}${token}/${method}`; | ||
| const form = new FormData(); | ||
| for (const [name, part] of Object.entries(parts)) { | ||
| if (part.filename !== undefined) { | ||
| // Binary field — wrap buffer in a Blob with a filename. | ||
| const buf = typeof part.value === "string" | ||
| ? Buffer.from(part.value) | ||
| : part.value; | ||
| form.append(name, new Blob([new Uint8Array(buf)], { type: "application/octet-stream" }), part.filename); | ||
| } | ||
| else { | ||
| form.append(name, typeof part.value === "string" ? part.value : String(part.value)); | ||
| } | ||
| } | ||
| let response; | ||
| try { | ||
| response = await fetch(url, { method: "POST", body: form }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const status = response.status; | ||
| const raw = await response.text(); | ||
| let decoded; | ||
| try { | ||
| decoded = raw ? JSON.parse(raw) : null; | ||
| } | ||
| catch { | ||
| decoded = null; | ||
| } | ||
| if (!decoded || typeof decoded !== "object") { | ||
| return errorReturn(`Telegram returned non-JSON for ${method}: ${raw.slice(0, 200)}`, "transport", { status }); | ||
| } | ||
| const d = decoded; | ||
| if (!d.ok) { | ||
| const description = String(d.description ?? "unknown_error"); | ||
| const code = status === 429 ? "rate_limited" : "telegram_error"; | ||
| return errorReturn(`Telegram ${method} failed: ${description}`, code, { | ||
| status, | ||
| telegram_error: description, | ||
| description, | ||
| error_code: Number(d.error_code ?? 0), | ||
| parameters: d.parameters && typeof d.parameters === "object" ? d.parameters : null, | ||
| }); | ||
| } | ||
| const result = d.result; | ||
| if (result && typeof result === "object") { | ||
| return result; | ||
| } | ||
| return { ok: true, result }; | ||
| } | ||
| // ── Small helpers ────────────────────────────────────────────────────── | ||
| /** | ||
| * Accept either an integer chat id, a numeric string, or `@username` / | ||
| * `-100…` style identifier and return whatever Telegram accepts on the wire. | ||
| * Returns empty string if the input is empty/invalid. | ||
| */ | ||
| function normalizeChatId(input) { | ||
| if (typeof input === "number" && Number.isInteger(input)) | ||
| return input; | ||
| if (typeof input === "string") { | ||
| const trimmed = input.trim(); | ||
| if (!trimmed) | ||
| return ""; | ||
| if (trimmed[0] === "@") | ||
| return trimmed; | ||
| if (/^-?\d+$/.test(trimmed)) { | ||
| // Telegram chat IDs can exceed Number.MAX_SAFE_INTEGER for some | ||
| // supergroups/channels — keep as string to preserve precision. | ||
| return trimmed; | ||
| } | ||
| return trimmed; | ||
| } | ||
| return ""; | ||
| } | ||
| /** | ||
| * Coerce a scalar to a string suitable for a multipart form value. | ||
| * Bools become 'true'/'false'; arrays/objects become JSON. | ||
| */ | ||
| function scalarToString(v) { | ||
| if (typeof v === "boolean") | ||
| return v ? "true" : "false"; | ||
| if (v !== null && (typeof v === "object" || Array.isArray(v))) { | ||
| return JSON.stringify(v); | ||
| } | ||
| return String(v); | ||
| } | ||
| /** | ||
| * Best-effort heuristic: treat as local path when it resolves to a file on | ||
| * disk and is NOT an http(s) URL. | ||
| */ | ||
| function looksLikeLocalPath(src) { | ||
| if (!src) | ||
| return false; | ||
| if (src.startsWith("http://") || src.startsWith("https://")) | ||
| return false; | ||
| try { | ||
| return existsSync(src); | ||
| } | ||
| catch { | ||
| return false; | ||
| } | ||
| } | ||
| /** | ||
| * Build the sendMessage body from a chat_id, text, and the options bag. | ||
| */ | ||
| function buildMessageBody(chatId, text, opts) { | ||
| const body = { chat_id: chatId, text }; | ||
| const map = { | ||
| parseMode: "parse_mode", | ||
| disableNotification: "disable_notification", | ||
| disableWebPagePreview: "disable_web_page_preview", | ||
| protectContent: "protect_content", | ||
| replyToMessageId: "reply_to_message_id", | ||
| replyMarkup: "reply_markup", | ||
| }; | ||
| for (const [opt, api] of Object.entries(map)) { | ||
| if (opts[opt] !== undefined) | ||
| body[api] = opts[opt]; | ||
| } | ||
| return body; | ||
| } | ||
| /** | ||
| * Route media-send requests (photo/document/sticker) either as a JSON | ||
| * payload (when the source is a URL or an existing file_id) or as a | ||
| * multipart upload (when the source is a readable local file path). | ||
| */ | ||
| async function sendMediaFile(token, method, fileField, source, chatId, extra, filename) { | ||
| if (looksLikeLocalPath(source)) { | ||
| let contents; | ||
| try { | ||
| contents = readFileSync(source); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(`Failed to read file at ${source}: ${e instanceof Error ? e.message : String(e)}`, "read_error"); | ||
| } | ||
| const fname = filename ?? basename(source); | ||
| const parts = {}; | ||
| parts.chat_id = { value: String(chatId) }; | ||
| for (const [k, v] of Object.entries(extra)) { | ||
| parts[k] = { value: scalarToString(v) }; | ||
| } | ||
| parts[fileField] = { value: contents, filename: fname }; | ||
| return httpMultipart(token, method, parts); | ||
| } | ||
| // Otherwise it's a file_id or https:// URL — simple JSON POST. | ||
| const body = { | ||
| chat_id: chatId, | ||
| [fileField]: source, | ||
| ...extra, | ||
| }; | ||
| return http(token, method, body); | ||
| } | ||
| // ── Handlers ─────────────────────────────────────────────────────────── | ||
| const getMe = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| return (await http(resolved.token, "getMe", {})); | ||
| }; | ||
| const sendMessage = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const text = String(args[2] ?? ""); | ||
| const opts = (args[3] && typeof args[3] === "object" ? args[3] : {}); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| if (!text) { | ||
| return errorReturn("text is required.", "telegram_error"); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| const body = buildMessageBody(chatId, text, opts); | ||
| return (await http(resolved.token, "sendMessage", body)); | ||
| }; | ||
| const editMessage = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const messageId = Number(args[2] ?? 0) | 0; | ||
| const text = String(args[3] ?? ""); | ||
| const opts = (args[4] && typeof args[4] === "object" ? args[4] : {}); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| if (messageId === 0) { | ||
| return errorReturn("messageId is required.", "telegram_error"); | ||
| } | ||
| if (!text) { | ||
| return errorReturn("text is required.", "telegram_error"); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| const body = { | ||
| chat_id: chatId, | ||
| message_id: messageId, | ||
| text, | ||
| }; | ||
| if (opts.parseMode !== undefined) | ||
| body.parse_mode = String(opts.parseMode); | ||
| if (opts.disableWebPagePreview !== undefined) | ||
| body.disable_web_page_preview = Boolean(opts.disableWebPagePreview); | ||
| if (opts.replyMarkup !== undefined) | ||
| body.reply_markup = opts.replyMarkup; | ||
| return (await http(resolved.token, "editMessageText", body)); | ||
| }; | ||
| const deleteMessage = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const messageId = Number(args[2] ?? 0) | 0; | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| if (messageId === 0) { | ||
| return errorReturn("messageId is required.", "telegram_error"); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| const result = await http(resolved.token, "deleteMessage", { | ||
| chat_id: chatId, | ||
| message_id: messageId, | ||
| }); | ||
| // Telegram returns bool true on success — surface it as `{ok: true, deleted: true}` | ||
| // when not an error envelope, matching the PHP behaviour. | ||
| if (result && | ||
| typeof result === "object" && | ||
| !("error" in result) && | ||
| result.ok === true) { | ||
| return { ok: true, deleted: true }; | ||
| } | ||
| return result; | ||
| }; | ||
| const sendPhoto = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const photo = String(args[2] ?? ""); | ||
| const opts = (args[3] && typeof args[3] === "object" ? args[3] : {}); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| if (!photo) { | ||
| return errorReturn("photo is required.", "telegram_error"); | ||
| } | ||
| const extra = {}; | ||
| if (opts.caption !== undefined) | ||
| extra.caption = String(opts.caption); | ||
| if (opts.parseMode !== undefined) | ||
| extra.parse_mode = String(opts.parseMode); | ||
| if (opts.hasSpoiler !== undefined) | ||
| extra.has_spoiler = Boolean(opts.hasSpoiler); | ||
| if (opts.disableNotification !== undefined) | ||
| extra.disable_notification = Boolean(opts.disableNotification); | ||
| if (opts.protectContent !== undefined) | ||
| extra.protect_content = Boolean(opts.protectContent); | ||
| if (opts.replyToMessageId !== undefined) | ||
| extra.reply_to_message_id = Number(opts.replyToMessageId) | 0; | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| return (await sendMediaFile(resolved.token, "sendPhoto", "photo", photo, chatId, extra)); | ||
| }; | ||
| const sendDocument = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const document = String(args[2] ?? ""); | ||
| const opts = (args[3] && typeof args[3] === "object" ? args[3] : {}); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| if (!document) { | ||
| return errorReturn("document is required.", "telegram_error"); | ||
| } | ||
| const extra = {}; | ||
| if (opts.caption !== undefined) | ||
| extra.caption = String(opts.caption); | ||
| if (opts.parseMode !== undefined) | ||
| extra.parse_mode = String(opts.parseMode); | ||
| if (opts.disableContentTypeDetection !== undefined) | ||
| extra.disable_content_type_detection = Boolean(opts.disableContentTypeDetection); | ||
| if (opts.disableNotification !== undefined) | ||
| extra.disable_notification = Boolean(opts.disableNotification); | ||
| if (opts.protectContent !== undefined) | ||
| extra.protect_content = Boolean(opts.protectContent); | ||
| if (opts.replyToMessageId !== undefined) | ||
| extra.reply_to_message_id = Number(opts.replyToMessageId) | 0; | ||
| const filename = opts.filename !== undefined ? String(opts.filename) : undefined; | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| return (await sendMediaFile(resolved.token, "sendDocument", "document", document, chatId, extra, filename)); | ||
| }; | ||
| const sendLocation = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const latitude = Number(args[2] ?? 0); | ||
| const longitude = Number(args[3] ?? 0); | ||
| const opts = (args[4] && typeof args[4] === "object" ? args[4] : {}); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| const body = { | ||
| chat_id: chatId, | ||
| latitude, | ||
| longitude, | ||
| }; | ||
| if (opts.horizontalAccuracy !== undefined) | ||
| body.horizontal_accuracy = Number(opts.horizontalAccuracy); | ||
| if (opts.livePeriod !== undefined) | ||
| body.live_period = Number(opts.livePeriod) | 0; | ||
| if (opts.heading !== undefined) | ||
| body.heading = Number(opts.heading) | 0; | ||
| if (opts.proximityAlertRadius !== undefined) | ||
| body.proximity_alert_radius = Number(opts.proximityAlertRadius) | 0; | ||
| if (opts.disableNotification !== undefined) | ||
| body.disable_notification = Boolean(opts.disableNotification); | ||
| if (opts.replyToMessageId !== undefined) | ||
| body.reply_to_message_id = Number(opts.replyToMessageId) | 0; | ||
| return (await http(resolved.token, "sendLocation", body)); | ||
| }; | ||
| const sendPoll = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const question = String(args[2] ?? ""); | ||
| const options = Array.isArray(args[3]) ? args[3] : []; | ||
| const opts = (args[4] && typeof args[4] === "object" ? args[4] : {}); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| if (!question) { | ||
| return errorReturn("question is required.", "telegram_error"); | ||
| } | ||
| if (options.length < 2 || options.length > 10) { | ||
| return errorReturn("A poll needs between 2 and 10 options.", "invalid_options"); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| const body = { | ||
| chat_id: chatId, | ||
| question, | ||
| options: options.map((o) => String(o)), | ||
| }; | ||
| if (opts.isAnonymous !== undefined) | ||
| body.is_anonymous = Boolean(opts.isAnonymous); | ||
| if (opts.type !== undefined) | ||
| body.type = String(opts.type); | ||
| if (opts.allowsMultipleAnswers !== undefined) | ||
| body.allows_multiple_answers = Boolean(opts.allowsMultipleAnswers); | ||
| if (opts.correctOptionId !== undefined) | ||
| body.correct_option_id = Number(opts.correctOptionId) | 0; | ||
| if (opts.explanation !== undefined) | ||
| body.explanation = String(opts.explanation); | ||
| if (opts.openPeriod !== undefined) | ||
| body.open_period = Number(opts.openPeriod) | 0; | ||
| if (opts.closeDate !== undefined) | ||
| body.close_date = Number(opts.closeDate) | 0; | ||
| if (opts.isClosed !== undefined) | ||
| body.is_closed = Boolean(opts.isClosed); | ||
| if (opts.disableNotification !== undefined) | ||
| body.disable_notification = Boolean(opts.disableNotification); | ||
| return (await http(resolved.token, "sendPoll", body)); | ||
| }; | ||
| const sendSticker = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| const sticker = String(args[2] ?? ""); | ||
| const opts = (args[3] && typeof args[3] === "object" ? args[3] : {}); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| if (!sticker) { | ||
| return errorReturn("sticker is required.", "telegram_error"); | ||
| } | ||
| const extra = {}; | ||
| if (opts.emoji !== undefined) | ||
| extra.emoji = String(opts.emoji); | ||
| if (opts.disableNotification !== undefined) | ||
| extra.disable_notification = Boolean(opts.disableNotification); | ||
| if (opts.protectContent !== undefined) | ||
| extra.protect_content = Boolean(opts.protectContent); | ||
| if (opts.replyToMessageId !== undefined) | ||
| extra.reply_to_message_id = Number(opts.replyToMessageId) | 0; | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| return (await sendMediaFile(resolved.token, "sendSticker", "sticker", sticker, chatId, extra)); | ||
| }; | ||
| const getUpdates = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const opts = (args[1] && typeof args[1] === "object" ? args[1] : {}); | ||
| const body = {}; | ||
| if (opts.offset !== undefined) | ||
| body.offset = Number(opts.offset) | 0; | ||
| if (opts.limit !== undefined) { | ||
| body.limit = Math.max(1, Math.min(100, Number(opts.limit) | 0)); | ||
| } | ||
| if (opts.timeout !== undefined) { | ||
| body.timeout = Math.max(0, Math.min(50, Number(opts.timeout) | 0)); | ||
| } | ||
| if (Array.isArray(opts.allowedUpdates)) { | ||
| body.allowed_updates = opts.allowedUpdates.map((u) => String(u)); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| const result = await http(resolved.token, "getUpdates", body); | ||
| // Re-tag the common "can't use getUpdates with webhook" case. | ||
| if (result && | ||
| typeof result === "object" && | ||
| "error" in result && | ||
| "description" in result) { | ||
| const r = result; | ||
| if (typeof r.description === "string" && | ||
| r.description.toLowerCase().includes("webhook is active")) { | ||
| r.code = "webhook_conflict"; | ||
| } | ||
| } | ||
| return result; | ||
| }; | ||
| const answerCallback = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const id = String(args[1] ?? ""); | ||
| const opts = (args[2] && typeof args[2] === "object" ? args[2] : {}); | ||
| if (!id) { | ||
| return errorReturn("callbackQueryId is required.", "telegram_error"); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| const body = { callback_query_id: id }; | ||
| if (opts.text !== undefined) | ||
| body.text = String(opts.text); | ||
| if (opts.showAlert !== undefined) | ||
| body.show_alert = Boolean(opts.showAlert); | ||
| if (opts.url !== undefined) | ||
| body.url = String(opts.url); | ||
| if (opts.cacheTime !== undefined) | ||
| body.cache_time = Number(opts.cacheTime) | 0; | ||
| return (await http(resolved.token, "answerCallbackQuery", body)); | ||
| }; | ||
| const getChat = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = normalizeChatId(args[1]); | ||
| if (chatId === "") { | ||
| return errorReturn("chatId is required.", "telegram_error"); | ||
| } | ||
| const resolved = await resolveToken(cred); | ||
| if ("error" in resolved) | ||
| return resolved; | ||
| return (await http(resolved.token, "getChat", { chat_id: chatId })); | ||
| }; | ||
| // ── Exports: functions map ───────────────────────────────────────────── | ||
| export const TelegramFunctions = { | ||
| getMe, | ||
| sendMessage, | ||
| sendPhoto, | ||
| sendDocument, | ||
| sendLocation, | ||
| sendPoll, | ||
| sendSticker, | ||
| editMessage, | ||
| deleteMessage, | ||
| getUpdates, | ||
| getChat, | ||
| answerCallback, | ||
| }; | ||
| // ── Exports: credential types ────────────────────────────────────────── | ||
| export const TelegramCredentialTypes = [ | ||
| { | ||
| slug: CREDENTIAL_TYPE, | ||
| title: "Telegram Bot Token", | ||
| icon: "telegram", | ||
| fields: [ | ||
| { | ||
| name: "token", | ||
| title: "Bot Token", | ||
| type: "password", | ||
| required: true, | ||
| placeholder: "123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11", | ||
| description: "Issued by @BotFather on Telegram. Format: `<bot_id>:<secret>`. Keep private — anyone with it controls the bot.", | ||
| pattern: "^[0-9]+:[A-Za-z0-9_-]{30,}$", | ||
| }, | ||
| ], | ||
| }, | ||
| ]; | ||
| // ── Shared parameter descriptors ─────────────────────────────────────── | ||
| const credentialParam = { | ||
| name: "credential", | ||
| title: "Credential", | ||
| description: "Slug of a saved `telegram_bot_token` credential. The bot token is decrypted at call time and spliced into the request URL path; it never appears in logs.", | ||
| dataType: "string", | ||
| formInputType: "resource", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "my_telegram_bot", | ||
| resource: { | ||
| type: "credential", | ||
| listFn: "credential.list", | ||
| modes: ["list", "expression"], | ||
| searchable: true, | ||
| filter: { type: CREDENTIAL_TYPE }, | ||
| }, | ||
| }; | ||
| const chatIdParam = { | ||
| name: "chatId", | ||
| title: "Chat ID", | ||
| description: "Target chat identifier. Either an integer ID (user: `123456789`, supergroup/channel: `-100…`) or `@channelusername` for a public channel. The bot must already be a member (or administrator, for channels).", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "@mychannel or -1001234567890", | ||
| }; | ||
| const messageIdParam = { | ||
| name: "messageId", | ||
| title: "Message ID", | ||
| description: "Integer ID of the target message as returned by a previous `sendMessage` call.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "42", | ||
| validation: { min: 1 }, | ||
| }; | ||
| const parseModeHelp = "Text formatting mode. One of:\n MarkdownV2 : recommended, strict escaping\n HTML : <b>, <i>, <a href>, <code>, <pre> tags\n Markdown : legacy, looser parser\nOmit for plain text."; | ||
| const messageOptionsBaseDescription = "Extra fields. Recognized keys:\n parseMode : 'MarkdownV2' | 'HTML' | 'Markdown'\n disableNotification : bool — send silently (no push)\n disableWebPagePreview : bool — suppress link previews\n protectContent : bool — forbid forwarding/saving\n replyToMessageId : int — quote another message\n replyMarkup : object — inline keyboard / reply keyboard"; | ||
| const messageOptionsParam = { | ||
| name: "options", | ||
| title: "Options", | ||
| description: messageOptionsBaseDescription, | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 6, | ||
| advanced: true, | ||
| }; | ||
| const telegramResponseSchema = { | ||
| type: "object", | ||
| properties: { | ||
| message_id: { | ||
| type: "int", | ||
| description: "ID of the resulting message", | ||
| }, | ||
| chat: { type: "object" }, | ||
| date: { type: "int" }, | ||
| text: { type: "string" }, | ||
| error: { | ||
| type: "string", | ||
| description: "Module error (transport, missing credential)", | ||
| }, | ||
| telegram_error: { | ||
| type: "string", | ||
| description: "Telegram-side description (e.g. chat not found)", | ||
| }, | ||
| }, | ||
| }; | ||
| const commonErrors = { | ||
| credential_not_found: "No credential with that slug exists in the vault.", | ||
| token_missing: "The credential exists but does not have a `token` field.", | ||
| transport: "Network failure calling api.telegram.org — see error message.", | ||
| telegram_error: "Telegram returned ok:false — see `description` and error_code fields.", | ||
| rate_limited: "HTTP 429 from Telegram. Honour the `retry_after` seconds field.", | ||
| }; | ||
| // ── Exports: function metadata ───────────────────────────────────────── | ||
| export const TelegramFunctionMetadata = { | ||
| // ── Bot ─────────────────────────────────────────────────────────── | ||
| getMe: { | ||
| title: "Get bot info", | ||
| summary: "Return identity of the bot backing the credential", | ||
| description: "Calls `getMe`. Useful as a credential health check — returns the bot's `id`, `username`, `first_name`, and feature flags.", | ||
| group: "bot", | ||
| action: "read", | ||
| icon: "bot", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "bot", "self", "health"], | ||
| parameters: [credentialParam], | ||
| returnType: "object", | ||
| returnDescription: "`{ id, is_bot, first_name, username, can_join_groups, can_read_all_group_messages, supports_inline_queries }`.", | ||
| errors: commonErrors, | ||
| examples: [ | ||
| { | ||
| title: "Sanity check a credential", | ||
| code: 'telegram.getMe "my_telegram_bot"', | ||
| }, | ||
| ], | ||
| example: 'telegram.getMe "my_telegram_bot"', | ||
| }, | ||
| // ── Messages ────────────────────────────────────────────────────── | ||
| sendMessage: { | ||
| title: "Send message", | ||
| summary: "Post a text message to a chat", | ||
| description: "Calls `sendMessage`. Supports Markdown/HTML via the `parseMode` option. Max length 4096 UTF-16 code units — messages longer than that must be split by the caller.", | ||
| group: "message", | ||
| action: "write", | ||
| icon: "send", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "send", "message", "notify"], | ||
| parameters: [ | ||
| credentialParam, | ||
| chatIdParam, | ||
| { | ||
| name: "text", | ||
| title: "Text", | ||
| description: "Message body (max 4096 chars). Honours `parseMode` option — see below.", | ||
| dataType: "string", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 4, | ||
| placeholder: "Hello from RobinPath!", | ||
| validation: { maxLength: 4096 }, | ||
| }, | ||
| { | ||
| ...messageOptionsParam, | ||
| description: `${messageOptionsBaseDescription}\n\n${parseModeHelp}`, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Telegram Message object: `{ message_id, from, chat, date, text }`.", | ||
| returnSchema: telegramResponseSchema, | ||
| errors: commonErrors, | ||
| examples: [ | ||
| { | ||
| title: "Notify a channel", | ||
| code: 'telegram.sendMessage "my_telegram_bot" "@mychannel" "Build complete"', | ||
| }, | ||
| { | ||
| title: "Rich formatting", | ||
| code: 'telegram.sendMessage "my_telegram_bot" "-1001234567890" "*Heads up*: deploy starting" {\n parseMode: "MarkdownV2",\n disableNotification: true\n}', | ||
| }, | ||
| ], | ||
| example: 'telegram.sendMessage "my_telegram_bot" "@mychannel" "Hello"', | ||
| }, | ||
| editMessage: { | ||
| title: "Edit message", | ||
| summary: "Edit the text of a message previously sent by the bot", | ||
| description: "Calls `editMessageText`. Only messages the same bot sent can be edited.", | ||
| group: "message", | ||
| action: "write", | ||
| icon: "edit-3", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "edit", "update"], | ||
| parameters: [ | ||
| credentialParam, | ||
| chatIdParam, | ||
| messageIdParam, | ||
| { | ||
| name: "text", | ||
| title: "New text", | ||
| description: "Replacement message body (max 4096 chars).", | ||
| dataType: "string", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 4, | ||
| validation: { maxLength: 4096 }, | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n parseMode : 'MarkdownV2' | 'HTML' | 'Markdown'\n disableWebPagePreview: bool\n replyMarkup : object — inline keyboard (reply keyboards can't be edited)", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 4, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Edited Telegram Message object.", | ||
| returnSchema: telegramResponseSchema, | ||
| errors: commonErrors, | ||
| examples: [ | ||
| { | ||
| title: "Flip a status message to done", | ||
| code: 'telegram.editMessage "my_telegram_bot" "@ops" 42 "Build PASSING ✓"', | ||
| }, | ||
| ], | ||
| example: 'telegram.editMessage "my_telegram_bot" "@ops" 42 "Updated"', | ||
| }, | ||
| deleteMessage: { | ||
| title: "Delete message", | ||
| summary: "Delete a message by ID", | ||
| description: "Calls `deleteMessage`. A bot can delete:\n - its own messages, up to 48h old in private chats\n - any message in a group/supergroup if it is an administrator with `can_delete_messages`\n - any message in a channel it administers", | ||
| group: "message", | ||
| action: "delete", | ||
| icon: "trash-2", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "delete"], | ||
| parameters: [credentialParam, chatIdParam, messageIdParam], | ||
| returnType: "boolean", | ||
| returnDescription: "`true` on success.", | ||
| errors: commonErrors, | ||
| example: 'telegram.deleteMessage "my_telegram_bot" "@ops" 42', | ||
| }, | ||
| // ── Media ───────────────────────────────────────────────────────── | ||
| sendPhoto: { | ||
| title: "Send photo", | ||
| summary: "Send a photo from a local file or file_id", | ||
| description: "Calls `sendPhoto`. The `photo` parameter accepts one of:\n - an absolute server-side path (multipart/form-data upload)\n - a previously uploaded Telegram `file_id` (passed as a normal string; no upload)\n - an https:// URL — Telegram fetches it directly\n\nMax 10 MB for downloaded URLs, 50 MB for local uploads, 20 MB on the Bot API in total.", | ||
| group: "media", | ||
| action: "upload", | ||
| icon: "image", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "photo", "image", "upload"], | ||
| parameters: [ | ||
| credentialParam, | ||
| chatIdParam, | ||
| { | ||
| name: "photo", | ||
| title: "Photo", | ||
| description: "Absolute server-side path, a Telegram `file_id`, or an https:// URL.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "/tmp/photo.jpg", | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n caption : string (max 1024 chars)\n parseMode : 'MarkdownV2' | 'HTML' | 'Markdown'\n hasSpoiler : bool — cover with spoiler animation\n disableNotification : bool\n protectContent : bool\n replyToMessageId : int", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 5, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Telegram Message object containing the uploaded photo.", | ||
| errors: { | ||
| ...commonErrors, | ||
| read_error: "Could not read the file at the supplied local path.", | ||
| }, | ||
| examples: [ | ||
| { | ||
| title: "Upload from disk", | ||
| code: 'telegram.sendPhoto "my_telegram_bot" "@gallery" "/var/www/uploads/graph.png" {\n caption: "Traffic for last 24h"\n}', | ||
| }, | ||
| ], | ||
| example: 'telegram.sendPhoto "my_telegram_bot" "@gallery" "/tmp/pic.jpg"', | ||
| }, | ||
| sendDocument: { | ||
| title: "Send document", | ||
| summary: "Send a generic file from a local path, file_id, or URL", | ||
| description: "Calls `sendDocument`. Same source rules as `sendPhoto`. Use this for PDFs, zips, CSVs — anything not an image/video/audio.", | ||
| group: "media", | ||
| action: "upload", | ||
| icon: "file", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "document", "file", "upload"], | ||
| parameters: [ | ||
| credentialParam, | ||
| chatIdParam, | ||
| { | ||
| name: "document", | ||
| title: "Document", | ||
| description: "Absolute server-side path, a Telegram `file_id`, or an https:// URL.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "/tmp/report.pdf", | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n caption : string (max 1024 chars)\n parseMode : 'MarkdownV2' | 'HTML' | 'Markdown'\n filename : override displayed file name (local uploads only)\n disableContentTypeDetection : bool\n disableNotification : bool\n protectContent : bool\n replyToMessageId : int", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 5, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Telegram Message object containing the document.", | ||
| errors: { | ||
| ...commonErrors, | ||
| read_error: "Could not read the file at the supplied local path.", | ||
| }, | ||
| example: 'telegram.sendDocument "my_telegram_bot" "@ops" "/tmp/report.pdf"', | ||
| }, | ||
| sendLocation: { | ||
| title: "Send location", | ||
| summary: "Send a GPS pin to a chat", | ||
| description: "Calls `sendLocation`. Optionally pass `livePeriod` in options to send a live-updating pin (60-86400 seconds).", | ||
| group: "media", | ||
| action: "write", | ||
| icon: "map-pin", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "location", "map"], | ||
| parameters: [ | ||
| credentialParam, | ||
| chatIdParam, | ||
| { | ||
| name: "latitude", | ||
| title: "Latitude", | ||
| description: "Decimal degrees, -90 to 90.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "48.8566", | ||
| validation: { min: -90, max: 90 }, | ||
| }, | ||
| { | ||
| name: "longitude", | ||
| title: "Longitude", | ||
| description: "Decimal degrees, -180 to 180.", | ||
| dataType: "number", | ||
| formInputType: "number", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "2.3522", | ||
| validation: { min: -180, max: 180 }, | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n horizontalAccuracy : float — meter radius (0-1500)\n livePeriod : int — seconds of live updates (60-86400)\n heading : int — direction of movement in degrees (1-360)\n proximityAlertRadius : int — metres for arrival alerts\n disableNotification : bool\n replyToMessageId : int", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 5, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Telegram Message object containing the location.", | ||
| errors: commonErrors, | ||
| example: 'telegram.sendLocation "my_telegram_bot" "@travel" 48.8566 2.3522', | ||
| }, | ||
| sendPoll: { | ||
| title: "Send poll", | ||
| summary: "Post a poll to a group or channel", | ||
| description: "Calls `sendPoll`. Telegram requires at least two options. Polls work in groups, supergroups and channels but not in private chats.", | ||
| group: "media", | ||
| action: "write", | ||
| icon: "bar-chart-2", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "poll", "vote"], | ||
| parameters: [ | ||
| credentialParam, | ||
| chatIdParam, | ||
| { | ||
| name: "question", | ||
| title: "Question", | ||
| description: "Poll question (max 300 chars).", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "Best language?", | ||
| validation: { maxLength: 300 }, | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Answer options", | ||
| description: "Array of 2-10 answer strings. Each answer max 100 chars.", | ||
| dataType: "array", | ||
| formInputType: "json", | ||
| required: true, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 4, | ||
| placeholder: '["TypeScript", "Rust", "Go"]', | ||
| }, | ||
| { | ||
| name: "pollOptions", | ||
| title: "Poll settings", | ||
| description: "Recognized keys:\n isAnonymous : bool — default true\n type : 'regular' | 'quiz'\n allowsMultipleAnswers : bool (regular polls only)\n correctOptionId : int — zero-based index (quiz polls only)\n explanation : string — shown after a wrong answer (quiz)\n openPeriod : int — seconds the poll stays open (5-600)\n closeDate : int — unix timestamp the poll closes\n isClosed : bool — create as already-closed\n disableNotification : bool", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 5, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Telegram Message object with `poll` populated.", | ||
| errors: { | ||
| ...commonErrors, | ||
| invalid_options: "Fewer than 2 or more than 10 options supplied.", | ||
| }, | ||
| examples: [ | ||
| { | ||
| title: "Team lunch poll", | ||
| code: 'telegram.sendPoll "my_telegram_bot" "-1001234567890" "Lunch?" ["Pizza", "Sushi", "Tacos"]', | ||
| }, | ||
| ], | ||
| example: 'telegram.sendPoll "my_telegram_bot" "@team" "?" ["a","b"]', | ||
| }, | ||
| sendSticker: { | ||
| title: "Send sticker", | ||
| summary: "Send a sticker by file_id", | ||
| description: "Calls `sendSticker`. Pass the sticker `file_id` — the id is long-lived and survives bot restarts. You can grab one by forwarding a sticker to your bot and reading `sticker.file_id` from `getUpdates`.", | ||
| group: "media", | ||
| action: "write", | ||
| icon: "smile", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "sticker"], | ||
| parameters: [ | ||
| credentialParam, | ||
| chatIdParam, | ||
| { | ||
| name: "sticker", | ||
| title: "Sticker", | ||
| description: "Telegram sticker `file_id` (or an absolute path / https URL for a local .webp upload).", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "CAACAgIAAxkBA...", | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n emoji : string — sticker emoji (upload only)\n disableNotification : bool\n protectContent : bool\n replyToMessageId : int", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 4, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Telegram Message object containing the sticker.", | ||
| errors: commonErrors, | ||
| example: 'telegram.sendSticker "my_telegram_bot" "@stickers" "CAACAgIAAxkBA..."', | ||
| }, | ||
| // ── Updates ─────────────────────────────────────────────────────── | ||
| getUpdates: { | ||
| title: "Get updates (long poll)", | ||
| summary: "Receive incoming updates via long polling", | ||
| description: "Calls `getUpdates`. Returns an array of `Update` objects. Use `offset` = last_update_id + 1 to acknowledge processed updates.\n\n**Warning:** this method conflicts with webhook mode. If your bot has a webhook set, `getUpdates` will return an error until you call `deleteWebhook` first.", | ||
| group: "updates", | ||
| action: "query", | ||
| icon: "inbox", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "updates", "poll", "webhook"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n offset : int — smallest update_id to return; previous ones are marked delivered\n limit : int 1-100 (default 100)\n timeout : int — long-poll seconds (0-50, default 0 for short poll)\n allowedUpdates : array<string> — filter types e.g. ['message','callback_query']", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 4, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "array", | ||
| returnDescription: "Array of Telegram `Update` objects.", | ||
| errors: { | ||
| ...commonErrors, | ||
| webhook_conflict: "Telegram refuses getUpdates when a webhook is active. Call deleteWebhook first.", | ||
| }, | ||
| examples: [ | ||
| { | ||
| title: "Drain the inbox", | ||
| code: 'telegram.getUpdates "my_telegram_bot" {offset: 0, limit: 50, timeout: 20}', | ||
| }, | ||
| ], | ||
| example: 'telegram.getUpdates "my_telegram_bot"', | ||
| }, | ||
| answerCallback: { | ||
| title: "Answer callback query", | ||
| summary: "Respond to an inline-keyboard button press", | ||
| description: "Calls `answerCallbackQuery`. Must be called within a few seconds of receiving a `callback_query` update, or Telegram shows a spinner to the user until timeout.", | ||
| group: "updates", | ||
| action: "write", | ||
| icon: "check-circle", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "callback", "inline"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "callbackQueryId", | ||
| title: "Callback query ID", | ||
| description: "The `id` of the callback_query you are answering.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "4382bfdwdsb323b2d9", | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n text : string — notification shown to the user (max 200 chars)\n showAlert : bool — modal instead of toast\n url : string — deep link to open\n cacheTime : int — seconds to cache the answer client-side", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 4, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "boolean", | ||
| returnDescription: "`true` on success.", | ||
| errors: commonErrors, | ||
| example: 'telegram.answerCallback "my_telegram_bot" "4382bfdwdsb..." {text: "Saved!"}', | ||
| }, | ||
| // ── Chats ───────────────────────────────────────────────────────── | ||
| getChat: { | ||
| title: "Get chat", | ||
| summary: "Return up-to-date information about a chat", | ||
| description: "Calls `getChat`. Works for users, groups, supergroups, and channels. Returns pinned message, permissions, sticker set, and member count (for groups).", | ||
| group: "chats", | ||
| action: "read", | ||
| icon: "info", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["telegram", "chat", "lookup"], | ||
| parameters: [credentialParam, chatIdParam], | ||
| returnType: "object", | ||
| returnDescription: "Telegram Chat object: `{ id, type, title?, username?, description?, pinned_message?, permissions? }`.", | ||
| errors: { | ||
| ...commonErrors, | ||
| chat_not_found: "Supplied chat_id does not resolve. For @channelusername the channel must be public; for numeric IDs the bot must be a member.", | ||
| }, | ||
| example: 'telegram.getChat "my_telegram_bot" "@mychannel"', | ||
| }, | ||
| }; | ||
| // ── Exports: module metadata ─────────────────────────────────────────── | ||
| export const TelegramModuleMetadata = { | ||
| slug: "telegram", | ||
| title: "Telegram", | ||
| summary: "Send messages, photos, documents, polls, stickers, and manage Telegram chats via the Bot API", | ||
| description: "Full Telegram Bot API integration. Requires a saved `telegram_bot_token` credential obtained from @BotFather.\n\nChat IDs can be either integer IDs (e.g. `123456789` for users, `-100…` for supergroups/channels) or `@username` for public channels. The bot must be an administrator of a channel before it can post there.\n\nEvery method returns the parsed `result` field from Telegram's JSON response. On failure the module returns `{error, code, telegram_error?, description?}` rather than throwing.", | ||
| category: "communication", | ||
| icon: "icon.svg", | ||
| color: "#26A5E4", | ||
| version: "0.2.0", | ||
| docsUrl: "https://docs.robinpath.com/modules/telegram", | ||
| status: "stable", | ||
| requires: [], | ||
| minNodeVersion: "18.0.0", | ||
| credentialsType: CREDENTIAL_TYPE, | ||
| operationGroups: { | ||
| bot: { | ||
| title: "Bot", | ||
| description: "Meta operations on the bot account itself.", | ||
| order: 1, | ||
| }, | ||
| message: { | ||
| title: "Messages", | ||
| description: "Send, edit, and delete text messages.", | ||
| order: 2, | ||
| }, | ||
| media: { | ||
| title: "Media", | ||
| description: "Send photos, documents, locations, polls, and stickers.", | ||
| order: 3, | ||
| }, | ||
| updates: { | ||
| title: "Updates", | ||
| description: "Long-poll for incoming updates and respond to callbacks.", | ||
| order: 4, | ||
| }, | ||
| chats: { | ||
| title: "Chats", | ||
| description: "Query chat metadata.", | ||
| order: 5, | ||
| }, | ||
| }, | ||
| methods: Object.keys(TelegramFunctions), | ||
| }; | ||
| //# sourceMappingURL=telegram.js.map |
| {"version":3,"file":"telegram.js","sourceRoot":"","sources":["../src/telegram.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAUH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,2EAA2E;AAE3E,MAAM,KAAK,GAA0B,EAAE,CAAC;AAExC,SAAS,IAAI;IACX,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,6HAA6H,CAC9H,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,CAAa;IAC7C,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;AACjB,CAAC;AAED,0EAA0E;AAE1E,MAAM,QAAQ,GAAG,8BAA8B,CAAC;AAChD,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAc7C,SAAS,WAAW,CAClB,KAAa,EACb,IAAY,EACZ,QAAiC,EAAE;IAEnC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB,CAAC;AAClD,CAAC;AAED,0EAA0E;AAE1E,KAAK,UAAU,YAAY,CACzB,cAAsB;IAEtB,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,WAAW,CAAC,8BAA8B,EAAE,sBAAsB,CAAC,CAAC;IAC7E,CAAC;IACD,IAAI,MAAsC,CAAC;IAC3C,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC,WAAW,CAAC,GAAG,CA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DAA0D;YACvE,KAAK,EAAE,CAAC;SACT;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,sBAAsB;YACnC,KAAK,EAAE,CAAC;SACT;KACF;IACD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC;CACxC,CAAC"} |
+17
-7
| { | ||
| "name": "@robinpath/telegram", | ||
| "version": "0.1.1", | ||
| "version": "0.3.0", | ||
| "publishConfig": { | ||
@@ -23,6 +23,6 @@ "access": "public" | ||
| "peerDependencies": { | ||
| "@robinpath/core": ">=0.20.0" | ||
| "@robinpath/core": ">=0.40.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@robinpath/core": "^0.30.1", | ||
| "@robinpath/core": "^0.40.0", | ||
| "typescript": "^5.6.0" | ||
@@ -34,3 +34,7 @@ }, | ||
| "messaging", | ||
| "api" | ||
| "api", | ||
| "chat", | ||
| "notification", | ||
| "bot", | ||
| "botfather" | ||
| ], | ||
@@ -40,7 +44,13 @@ "license": "MIT", | ||
| "category": "messaging", | ||
| "type": "integration", | ||
| "auth": "bearer-token", | ||
| "type": "module", | ||
| "auth": "credential-vault", | ||
| "functionCount": 12, | ||
| "baseUrl": "https://api.telegram.org" | ||
| "baseUrl": "https://api.telegram.org", | ||
| "language": "nodejs", | ||
| "platforms": [ | ||
| "cloud", | ||
| "cli", | ||
| "desktop" | ||
| ] | ||
| } | ||
| } |
+1
-1
@@ -22,3 +22,3 @@ # @robinpath/telegram | ||
| ```bash | ||
| npm install @robinpath/telegram | ||
| robinpath add @robinpath/telegram | ||
| ``` | ||
@@ -25,0 +25,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Network access
Supply chain riskThis module accesses the network.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
96657
2150.45%10
400%1301
Infinity%2
100%3
50%