n8n node for Telegram Client API with full user capabilities
npm install n8n-nodes-telegram-client-cryptorailyn8n-nodes-telegram-client
bash
npm install n8n-nodes-telegram-client
`
Configuration
$3
1. Go to my.telegram.org
2. Log in and create an application
3. Note down your api_id and api_hash
$3
1. Go to Credentials
2. Click Create New Credentials
3. Select Telegram Client API
4. Fill in:
- API ID (from my.telegram.org)
- API Hash (from my.telegram.org)
- Phone Number (international format)
- 2FA Password (if enabled)
First Use
1. When using the node for the first time, you'll be prompted for a verification code
2. Enter the code sent to your Telegram account
3. The session will be saved for future use
Usage
$3
#### Message Operations
- sendMessage: Send text messages
- replyToMessage: Reply to existing messages
- editMessage: Edit sent messages
- deleteMessages: Delete messages
- forwardMessages: Forward messages
- pinMessage: Pin messages in chats
#### Media Operations
- sendMedia: Send photos, videos, or documents
- sendAlbum: Send multiple media files as an album
- downloadMedia: Download media from messages
#### Chat Operations
- getChatHistory: Get chat message history
- joinChat: Join channels or groups
- leaveChat: Leave channels or groups
$3
#### Send Message
`json
{
"operation": "sendMessage",
"chatId": "@username or chat_id",
"messageText": "Hello from n8n!"
}
`
#### Send Media
`json
{
"operation": "sendMedia",
"chatId": "@username or chat_id",
"filePath": "/path/to/file.jpg",
"mediaType": "photo"
}
`
Error Handling
The node includes comprehensive error handling:
- Authentication errors
- Network issues
- Invalid parameters
- API limitations
Security
- Credentials are stored securely in n8n
- Session strings are encrypted
- 2FA support included
- No plaintext password storage
Development
$3
`bash
npm install
npm run build
`
$3
`bash
npm test
`
$3
`bash
npm run lint
`
Contributing
1. Fork the repository
2. Create your feature branch (git checkout -b feature/AmazingFeature)
3. Commit your changes (git commit -m 'Add some AmazingFeature')
4. Push to the branch (git push origin feature/AmazingFeature`)