Auto Messages & Greetings
Relevant source files
The following files were used as context for generating this wiki page:
Auto Messages & Greetings consist of automated responses triggered by specific user interactions or temporal events. In the Telegram Summary Bot project, these features range from immediate command-based replies in the minimal Python bot to complex, scheduled events managed through the TelePilot MiniApp dashboard.
The system automates communication by sending pre-configured text or media to users and channels. This includes standard greeting commands like /start and /help, as well as more advanced triggers such as new member joins, birthdays, and periodic milestones.
Sources: README.md:144-150, bot.py:108-115
Command-Based Greetings
The core Python bot implementation handles basic greeting logic through command listeners. These functions provide immediate feedback to users when they first interact with the bot or request assistance.
Start Command Logic
When a user sends the /start command, the bot validates the chat ID and responds with a status confirmation. This ensures the user knows the bot is active and ready to receive further instructions.
The diagram shows the logic flow for a basic greeting trigger in the minimal bot implementation.
Sources: bot.py:108-111
Help Information
The /help command triggers a static response that outlines available features, such as text summarization and group privacy tips. This function centralizes the bot's documentation for the end-user.
| Command | Action | Output |
|---|---|---|
/start | Health check | Confirms bot status |
/help | Information retrieval | Lists all available commands and tips |
Sources: README.md:8-9, bot.py:96-105
Advanced Auto Messages (TelePilot Dashboard)
The project documentation describes an "Ultimate Telegram Channel & Group Manager" that extends standard greetings into a comprehensive automation suite. This suite manages member lifecycle events and scheduled greetings.
Member Lifecycle Greetings
The system triggers specific messages based on member transitions. These automations support the following events:
- Welcome Messages: Sent immediately when a new member joins a group or channel.
- Goodbye Messages: Triggered when a member leaves the community.
- Join Requests: Automated workflows for approving or managing new membership requests.
Sources: README.md:144-145, README.md:163-167
Dynamic Placeholders
To personalize automated messages, the system replaces specific tags with real-time data from the Telegram API.
| Placeholder | Description |
|---|---|
{name} | The display name of the target user |
{username} | The @handle of the target user |
{channel} | The name of the channel or group where the message is sent |
Sources: README.md:140-143
Temporal and Event-Based Greetings
Beyond manual triggers, the system supports greetings based on calendar events and scheduled intervals.
- Periodic Greetings: Automated messages for "New Month" or "New Year" milestones.
- Personal Greetings: Automated "Birthday" messages sent to specific users.
- Scheduled Posts: Messages configured to send at a specific date and time with retry logic.
Sources: README.md:133-134, README.md:146-147
Message Delivery Architecture
Automated messages are delivered through the Telegram Bot API using the sendMessage method. The system handles payload construction, including chat IDs and reply logic, while enforcing a maximum character limit of 4096 characters per message.
The sequence diagram illustrates the transmission of an automated message from the bot to the final user.
Sources: bot.py:65-71, bot.py:74-79
Technical Configuration
Configurations for message delivery and bot behavior are managed via environment variables and local constants.
| Variable | Description | Source |
|---|---|---|
TELEGRAM_BOT_TOKEN | Authentication for the Telegram API | bot.py:22 |
POLL_TIMEOUT | Long-poll duration for update detection | bot.py:23 |
MAX_STORED_MESSAGES | Retention limit for chat history context | bot.py:24 |
Summary
The Auto Messages & Greetings system provides a scalable solution for Telegram interaction, ranging from simple command responses in bot.py to sophisticated, placeholder-driven greetings within the TelePilot dashboard. By automating welcomes, farewells, and milestone greetings, the system reduces manual moderation effort while maintaining high engagement.
Sources: README.md:144-150, bot.py:108-115