* feat(telegram): add CLI project with Bot API client * feat(telegram): add telegram-send plugin-tool * test(telegram): add unit tests for markdown, config, api * chore(env): add TELEGRAM_CHAT_ID to .env.example * docs(handoff): add handoff and ADR for telegram-send * docs(handoff): set PR number 174 * docs: update project map for telegram-send tool --------- Co-authored-by: opencode-agent <agent@opencode.local>
18 lines
No EOL
960 B
TypeScript
18 lines
No EOL
960 B
TypeScript
// Manual E2E test — run with:
|
|
// node --experimental-strip-types tests/e2e.manual.ts
|
|
// Requires real TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID env vars.
|
|
import { sendMessage, sendDocument, sendPhoto } from "../src/api.ts"
|
|
import { loadConfig } from "../src/config.ts"
|
|
|
|
async function main() {
|
|
const { token, chatId } = loadConfig()
|
|
console.log("[e2e] sending text to", chatId)
|
|
const r1 = await sendMessage(token, chatId, "E2E test: *bold* _italic_ `code`", "MarkdownV2")
|
|
console.log("[e2e] text sent:", r1)
|
|
// document + photo — раскомментируй и подставь пути к реальным файлам:
|
|
// const r2 = await sendDocument(token, chatId, "/path/to/file.md", "caption")
|
|
// console.log("[e2e] document sent:", r2)
|
|
// const r3 = await sendPhoto(token, chatId, "/path/to/cover.png", "cover")
|
|
// console.log("[e2e] photo sent:", r3)
|
|
}
|
|
main().catch((e) => { console.error("[e2e] failed:", e); process.exit(1) }) |