Overview
Telegram Bot features:- Link Telegram account to Aya profile
- Join community Telegram groups via membership
- Receive bulletin digests in Telegram
- Get mailbox notifications
- Webhook and polling modes for deployment flexibility
The bot operates in two modes: webhook (production, real-time) and polling (development, pull-based).
Bot Setup
Finding the Bot
Search for @AyaBot on Telegram or use the direct link:Linking Your Account
External Code System
Linking uses temporary external codes:- Codes expire after 5 minutes
- One-time use (consumed_at set on redemption)
- Random 6-character alphanumeric
- Stored with Telegram user metadata
Profile Link Details
Linked Telegram appears on profile:- remote_id: Telegram user ID (used for bot messaging)
- public_id: Telegram username (displayed publicly)
- is_verified: Always true (verified via bot linking)
- is_managed: True (system manages this link)
Community Group Integration
Setting Up Group for Community
Community/organization admins can link Telegram groups:Add @AyaBot as admin
Invite bot and promote to admin with permissions:
- Invite users via link
- Manage chat
Register group on Aya
Navigate to community settings → Integrations → Telegram GroupsEnter registration code
Configure access control
Set minimum membership level required to join group:
- Follower, Member, Contributor, Maintainer, Lead
Group Registration Code
Member Invitations
When a user gains appropriate membership level:System checks eligibility
- User has linked Telegram account
- User’s membership level meets group requirement
- User is member of appropriate teams (if team-restricted)
Invitation created
- Bot generates unique invite link
- Invitation envelope sent to user’s mailbox
- Properties include group info and invite link
User receives invitation
Mailbox notification with:
- Group name and description
- Profile context
- One-click join link
Invitations are sent automatically. Users don’t need to request access - they receive invites when eligible.
Telegram Profile Link Visibility
Control who sees your Telegram link:Public
Everyone sees your username
Followers
Only followers and above
Members
Only members of your communities
- Public: Open to DMs from anyone
- Followers: Limit to engaged audience
- Members: Private, community-only contact
Bot Commands
User Commands
/start
Initiate bot conversation and get linking code
/link
Get a new linking code (if previous expired)
/status
Check your linking status
/unlink
Unlink your Telegram account from Aya
Admin Commands
/register [profile-slug]
(Admin-only, used in groups)
Generate registration code to link group to Aya profile
Notification Delivery
Bulletin Digests
Receive content digests via Telegram:- Subscribe to profiles with Telegram channel
- Choose frequency (daily, bi-daily, weekly)
- Digests formatted with Markdown
- Direct links to stories
- Grouped by followed profile
Mailbox Notifications
Receive mailbox alerts:- New message notifications
- Invitation alerts
- Real-time delivery (webhook mode)
- Customizable notification settings
Deployment Modes
Webhook Mode (Production)
How it works:- Telegram sends updates to configured webhook URL
- Aya server receives and processes immediately
- Real-time responses sent back to Telegram
- Real-time message delivery
- Lower latency
- Efficient (no polling overhead)
- Scales better
Polling Mode (Development)
How it works:- Aya server periodically asks Telegram for updates
- Processes any new messages
- Responds to Telegram API
- Simpler setup (no public URL needed)
- Good for development
- Works behind firewalls
Privacy & Security
Data Stored
Aya stores minimal Telegram data:- Telegram user ID (for messaging)
- Telegram username (for profile display)
- Link creation timestamp
- No message content stored
Bot Permissions
Bot requires:- Read messages (to process commands)
- Send messages (to send notifications)
- Invite users (for group management)
Bot cannot read messages in groups unless mentioned. It only processes direct commands.
Security Best Practices
For Users
For Users
- Verify you’re messaging @AyaBot (check verified badge)
- Don’t share verification codes
- Unlink account if compromised
- Review linked accounts regularly
For Community Admins
For Community Admins
- Only add bot to official community groups
- Revoke bot admin if group is disbanded
- Monitor group registrations
- Document group purpose in resource description
Troubleshooting
Cannot link account
Cannot link account
- Ensure you’ve started conversation with @AyaBot
- Check verification code hasn’t expired (5 min)
- Verify code is entered correctly (case-sensitive)
- Try generating new code with
/link - Check you have Aya individual profile
Not receiving notifications
Not receiving notifications
- Verify account is linked (
/statuscommand) - Check you haven’t blocked @AyaBot
- Ensure Telegram privacy settings allow bot messages
- Review subscription settings on Aya
- Check bot service status
Group registration fails
Group registration fails
- Verify bot is admin in group
- Check registration code hasn’t expired (10 min)
- Ensure you’re owner/lead of Aya profile
- Try generating new code
- Check group type (must be group, not channel)
Cannot join group
Cannot join group
- Verify you have appropriate membership level
- Check your Telegram account is linked
- Look for invitation in mailbox
- Ensure invitation hasn’t expired
- Contact community admins
API Integration
Developers can integrate Telegram features:Link Telegram Account
Send Telegram Notification
Rate Limits
Linking
5 codes per hour per user
Commands
10 commands per minute per user
Notifications
100 notifications per hour per profile
Group Registration
3 registrations per hour per group
Best Practices
For Personal Use
For Personal Use
- Link account to receive digests
- Set appropriate link visibility
- Enable notifications for important communities
- Use
/statusto verify linking periodically - Unlink if changing Telegram account
For Community Admins
For Community Admins
- Create dedicated group for community
- Set clear group rules and description
- Use membership levels to control access
- Monitor group activity
- Document group purpose in Aya resources
- Consider multiple groups for sub-communities
For Developers
For Developers
- Use webhook mode in production
- Implement webhook signature verification
- Handle rate limits gracefully
- Log bot interactions for debugging
- Test in polling mode locally
Roadmap
Planned features:- Rich message formatting (bold, links)
- Inline buttons for actions
- Group admin commands (kick, ban)
- Multi-group management
- Channel support
- Bot analytics dashboard
- Custom notification preferences
- Message templates
Next Steps
Bulletin Board
Configure Telegram digests
Mailbox
Receive invitations via Telegram
Communities
Set up community Telegram groups
Profiles
Manage Telegram link visibility