add telegram

Other Community

Skill notes

1. Install Grammy

Grammy is a modern, TypeScript-first Telegram bot framework.

2. Create Telegram Bot

Tell the user: I need you to create a Telegram bot: 1. Open Telegram and search for @BotFather 2. Send /newbot and follow prompts: - Bot name: Something friendly (e.g., "Andy Assistant")

3. Get Chat ID

Tell the user: To register a chat, you need its Chat ID. Here's how: For Private Chat (DM with bot): 1. Search for your bot in Telegram 2. Start a chat and send any message

Questions to Ask

Before making changes, ask: Mode: Replace WhatsApp or add alongside it? If replace: Set TELEGRAM_ONLY=true If alongside: Both will run Chat behavior: Should this chat respond to all messages or only when @mentioned?

Step 1: Update Configuration

Read src/config.ts and add Telegram config exports: These should be added near the top with other configuration exports.

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Other
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@0-CYBERDYNE-SYSTEMS-0 · no license declared
Token usage
Lean
Setup complexity
Guided setup
External API key
Not required
Operating systems
macOS · Linux · Windows
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
  • Env read
Network behavior
External requests
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

01
Step 1: Update Configuration

Read `src/config.ts` and add Telegram config exports: These should be added near the top with other configuration exports.

02
Step 2: Add storeMessageDirect to Database

Read `src/db.ts` and add this function (place it near the `storeMessage` function): Also update the db.ts exports to include `storeMessageDirect`.

03
Step 3: Create Telegram Module

Create `src/telegram.ts` with this content:

04
Step 4: Update Main Application

Modify `src/index.ts`: Add imports at the top: Update `sendMessage` function to route by channel. Find the `sendMessage` function and replace it with: Update `main()` function. Find the `main()` function and update it to support Telegram. Add this before the `connectWhatsApp()` call: Wrap the `connectWhatsApp()` call to support Telegram-only mode. Replace:

05
Step 5: Update Environment

Add to `.env`:

06
Step 6: Register a Telegram Chat

After installing and starting the bot, tell the user: 1. Send `/chatid` to your bot (in private chat or in a group) 2. Copy the chat ID (e.g., `tg:123456789` or `tg:-1001234567890`) 3. I'll add it to registered_groups.json Then update `data/registered_groups.json`:

07
Step 7: Build and Restart

Or for systemd:

08
Step 8: Test

Tell the user: Send a message to your registered Telegram chat: - For main chat: Any message works - For non-main: `@Andy hello` or @mention the bot Check logs: `tail -f logs/nanoclaw.log`

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.