- Add TelegramListener node for receiving messages - Add SaveToTelegram node for sending responses - Include comprehensive documentation and examples - Set up proper project structure with requirements
1.8 KiB
1.8 KiB
Example Workflow: Telegram Echo Bot
This example demonstrates how to create a simple echo bot using the Telegram custom nodes.
Workflow Steps:
-
Telegram Listener Node
- Input your bot token
- Set timeout to 30 seconds (or desired wait time)
- This will output the received message text and chat ID
-
Processing (Optional)
- You can add any processing nodes here
- For example: text transformation, AI processing, image generation, etc.
-
Save to Telegram Node
- Use the same bot token
- Connect the chat_id from the listener
- Connect your processed message (or just echo the original)
ComfyUI Workflow JSON
{
"1": {
"inputs": {
"bot_token": "YOUR_BOT_TOKEN_HERE",
"timeout": 30
},
"class_type": "TelegramListener",
"_meta": {
"title": "Telegram Listener"
}
},
"2": {
"inputs": {
"text": [
"1",
0
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "Echo the message"
}
},
"3": {
"inputs": {
"bot_token": "YOUR_BOT_TOKEN_HERE",
"chat_id": [
"1",
1
],
"message": [
"1",
0
]
},
"class_type": "SaveToTelegram",
"_meta": {
"title": "Send back to Telegram"
}
}
}
Setup Instructions:
- Replace
YOUR_BOT_TOKEN_HEREwith your actual bot token from BotFather - Load this workflow in ComfyUI
- Queue the workflow
- Send a message to your bot in Telegram
- The bot will echo the message back to you
Advanced Usage:
You can extend this workflow by:
- Adding image generation nodes between the listener and sender
- Processing the text through AI models
- Adding conditional logic based on message content
- Storing conversation history
- Adding multiple response types