Member Management
Relevant source files
The following files were used as context for generating this wiki page:
Member Management encompasses the systems used to track, categorize, and interact with users within Telegram channels and groups. The system operates through two primary layers: a minimal Python-based bot for message processing and a high-level MiniApp control panel for administrative operations.
The bot component tracks recent message history per chat to provide summaries, while the management dashboard provides advanced tools for audience segmentation, moderation, and activity tracking.
Sources: README.md:1-10, README.md:120-130, bot.py:23-25
Audience Segmentation and Tracking
The system categorizes members into specific segments to enable targeted interactions. These segments allow administrators to filter users based on their engagement levels and account status.
| Segment | Description |
|---|---|
| All | Every member tracked by the bot across all managed channels. |
| VIP | High-priority members manually designated by administrators. |
| Premium | Members identified with Telegram Premium status or specific internal tiers. |
| Active | Members who have recently interacted or posted messages. |
| New | Members who have joined within a specific recent timeframe. |
| By Channel | Members grouped according to the specific channel they joined. |
Sources: README.md:139-145
Data Flow for Member Activity
The Python bot tracks member activity by capturing incoming text messages and storing them in a memory-efficient buffer. This data provides the foundation for activity tracking and summarization.
The bot uses a defaultdict of deques to store recent messages per chat ID. The MAX_STORED_MESSAGES environment variable controls the buffer size for each chat.
Sources: bot.py:23-25, bot.py:107-119
Moderation and Access Control
Member management includes a moderation suite to maintain group order and verify new members. The system implements automated actions based on member behavior.
Moderation Features
- Prohibited Words Filter: Automatically triggers actions when members use restricted terms.
- CAPTCHA Verification: Requires new members to complete a challenge to prevent bot entries.
- Warning System: Issues formal warnings to members before applying bans or mutes.
- Join Requests: Allows administrators to manage and auto-approve requests to join private groups.
Sources: README.md:158-167
Administrative Roles
The system defines three distinct levels of authority for managing members and bot configurations.
Permissions are granular and can be assigned per admin. All administrative actions are recorded in a full audit log.
Sources: README.md:183-188
Interaction and Broadcasting
Administrators interact with members through smart broadcasting and automated messaging systems. The system supports direct messaging to users or posting to entire channels.
Automated Messages
The system triggers specific messages based on member lifecycle events:
- Welcome Messages: Sent immediately when a new member joins.
- Goodbye Messages: Sent when a member leaves the group.
- Cyclic Greetings: Automated messages for birthdays, new months, or new years.
Sources: README.md:152-156
Broadcast Workflow
Broadcasting utilizes seven audience segments to deliver targeted content.
The system supports full media (photos, videos, polls) and includes retry logic for failed deliveries.
Sources: README.md:138-143, README.md:172-175
Analytics and Reporting
Member Management includes tools for visualizing growth and engagement. Administrators can track joins, leaves, and overall member trends through the control panel.
- Growth Charts: Visual representation of member count over time.
- Activity Tracking: Analysis of member engagement and message frequency.
- CSV Export: Capability to export member lists and categories for external analysis.
- Daily Breakdowns: Reports showing daily fluctuations in member counts and interactions.
Sources: README.md:130-132, README.md:177-181
The member management system provides a comprehensive framework for scaling Telegram communities by combining automated moderation with granular audience segmentation and detailed engagement analytics.