telegram-init
npx machina-cli add skill lycfyi/community-agent-plugin/telegram-init --openclawtelegram-init
Initialize Telegram connection and configure sync settings.
Trigger Phrases
- "set up Telegram"
- "configure Telegram"
- "initialize Telegram"
- "connect Telegram"
- "telegram init"
Description
This skill initializes your Telegram connection by:
- Validating your Telegram API credentials
- Testing the session string authentication
- Listing all accessible groups and channels
- Optionally setting a default group for other commands
Prerequisites
Before using this skill, you must:
-
Get API credentials from https://my.telegram.org/apps
- Log in with your phone number
- Create an application
- Note your
API_IDandAPI_HASH
-
Generate a session string using:
python ${CLAUDE_PLUGIN_ROOT}/scripts/generate_session.pyThis will prompt for your phone number and verification code.
-
Add credentials to .env:
TELEGRAM_API_ID=your_api_id TELEGRAM_API_HASH=your_api_hash TELEGRAM_SESSION=your_session_string
Usage
Basic initialization:
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_init.py
Set a specific group as default:
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_init.py --group 1234567890
Output
- Lists all accessible groups with ID, type, and member count
- Updates
config/agents.yamlwith Telegram settings - Displays next steps for syncing messages
Warning
Using a user token may violate Telegram's Terms of Service. This tool is intended for personal use only:
- Archiving your own conversations
- Analyzing communities you actively participate in
Use at your own risk.
Exit Codes
0- Success1- Authentication error (invalid/expired session)2- Configuration error (missing credentials)
Related Skills
telegram-list- List groups and topicstelegram-sync- Sync messages to local storagetelegram-read- Read synced messages
Source
git clone https://github.com/lycfyi/community-agent-plugin/blob/main/plugins/telegram-connector/skills/telegram-init/SKILL.mdView on GitHub Overview
telegram-init initializes your Telegram connection and configures sync settings. It validates API credentials, tests the session, lists accessible groups and channels, and can set a default group for subsequent commands.
How This Skill Works
The skill validates the provided API_ID and API_HASH, tests the Telegram session string authentication, and enumerates all accessible groups and channels. It then updates the agent's configuration (config/agents.yaml) with Telegram settings and optionally applies a default group for downstream commands.
When to Use It
- You are setting up Telegram for the first time.
- You want to validate credentials before enabling message syncing.
- You need to see all accessible groups and channels and their metadata.
- You want to set a default Telegram group for future commands.
- You are troubleshooting authentication or configuration errors.
Quick Start
- Step 1: Get API credentials from my.telegram.org/apps and generate a session string using the provided script.
- Step 2: Add TELEGRAM_API_ID, TELEGRAM_API_HASH, and TELEGRAM_SESSION to the .env file.
- Step 3: Run: python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_init.py (optionally add --group <id> to set a default).
Best Practices
- Store API credentials securely in .env: TELEGRAM_API_ID, TELEGRAM_API_HASH, TELEGRAM_SESSION.
- Generate a fresh session string with the provided script before connecting.
- Run telegram_init.py to verify access and automatically update config/agents.yaml.
- Choose a default group that aligns with your primary workflow to simplify commands.
- Be mindful of Telegram's Terms of Service and limit usage to personal data and permitted activities.
Example Use Cases
- A new user connects Telegram to the agent and receives a list of groups and channels.
- A team sets a default 'DevOps Alerts' group for automated notifications.
- An admin runs generate_session.py, then completes setup with telegram_init.py.
- Initialization fails due to an authentication error, prompting credential verification.
- Config/agents.yaml is updated automatically after successful Telegram initialization.