-
Notifications
You must be signed in to change notification settings - Fork 1
First Bot
Step-by-step guide to create and deploy your first RSS bot using RssBot Platform.
By the end of this guide, you'll have:
- ✅ A working Telegram bot that processes RSS feeds
- ✅ RSS feed subscriptions for your channels/groups
- ✅ Automated content delivery with smart formatting
- ✅ Basic understanding of RssBot Platform capabilities
Before starting, ensure you have:
- ✅ RssBot Platform installed (Installation Guide)
- ✅ Telegram Bot Token from @BotFather
- ✅ Basic understanding of Telegram bots
- ✅ 10-15 minutes of time
- Message @BotFather on Telegram
-
Send
/newbotcommand - Choose a name (e.g., "My RSS Reader")
- Choose a username ending in "bot" (e.g., "myrssreaderbot")
- Copy the token you receive
Add your bot token to the .env file:
TELEGRAM_BOT_TOKEN=123456789:ABC-DEF1234567890-123456789012345# Start RssBot Platform
python -m rssbot
# Verify it's running
curl http://localhost:8004/health- Find your bot on Telegram using the username you created
-
Send
/startto begin - You should receive a welcome message
# Check bot service status
curl http://localhost:8004/services/bot_svc/status
# Should show the service is running and connected# Add a popular tech news feed
curl -X POST http://localhost:8004/services/db_svc/feeds \
-H "Content-Type: application/json" \
-d '{
"url": "https://feeds.feedburner.com/oreilly",
"title": "O'\''Reilly Media News",
"chat_id": YOUR_TELEGRAM_USER_ID,
"update_interval": 3600
}'To find your user ID, you can:
Method 1: Use @userinfobot
- Message @userinfobot on Telegram
- It will reply with your user ID
Method 2: Check RssBot logs
- Send any message to your bot
- Check the platform logs for your user ID
Method 3: Use the API
# List recent bot interactions
curl http://localhost:8004/services/bot_svc/recent-usersAlternatively, you can add feeds directly through your bot:
-
Send
/subscribe https://feeds.feedburner.com/oreillyto your bot - Follow the prompts to configure the feed
- Confirm the subscription
# Set update interval to 30 minutes
curl -X PUT http://localhost:8004/services/db_svc/feeds/1 \
-H "Content-Type: application/json" \
-d '{
"update_interval": 1800,
"active": true
}'# Configure AI service for content summarization
curl -X POST http://localhost:8004/services/ai_svc/connection-method \
-H "Content-Type: application/json" \
-d '{"connection_method": "hybrid"}'
# Enable AI processing for your feed
curl -X PUT http://localhost:8004/services/db_svc/feeds/1 \
-H "Content-Type: application/json" \
-d '{
"ai_processing": true,
"ai_summary": true,
"ai_max_length": 200
}'By default, RssBot sends messages in this format:
📰 **Article Title**
Summary or first paragraph...
🔗 [Read More](https://example.com/article)
📅 Published: Jan 15, 2024
# Set custom message template
curl -X PUT http://localhost:8004/services/db_svc/feeds/1 \
-H "Content-Type: application/json" \
-d '{
"message_template": "🚀 **{title}**\n\n{summary}\n\n👉 {link}\n🕒 {published_date}"
}'Available template variables:
-
{title}- Article title -
{summary}- Article summary or description -
{link}- Article URL -
{published_date}- Publication date -
{author}- Author name (if available) -
{category}- Article category (if available)
# Trigger manual feed update
curl -X POST http://localhost:8004/services/db_svc/feeds/1/update
# Check for new items
curl http://localhost:8004/services/db_svc/feeds/1/items?limit=5# Watch feed processing in real-time
curl http://localhost:8004/services/db_svc/feeds/1/status
# Check processing logs
curl http://localhost:8004/admin/logs/channel_mgr_svc?limit=20Configure your bot's command menu by messaging @BotFather:
/setcommands
# Then send these commands:
start - Start the bot and see welcome message
help - Get help and usage information
subscribe - Subscribe to an RSS feed
unsubscribe - Remove RSS feed subscription
list - List all your subscriptions
settings - Manage your preferences
status - Check feed status and statistics
Your bot automatically supports these commands:
-
/start- Welcome message and quick start -
/help- Detailed help information -
/subscribe <url>- Add new RSS feed -
/unsubscribe <id>- Remove RSS feed -
/list- Show all subscriptions -
/settings- Configure preferences
Try these commands with your bot:
/list
# Should show your O'Reilly Media subscription
/settings
# Opens settings menu with options
/subscribe https://rss.cnn.com/rss/edition.rss
# Adds CNN RSS feed
For optimal performance, configure services appropriately:
# Set database service to router mode (fastest for core operations)
curl -X POST http://localhost:8004/services/db_svc/connection-method \
-d '{"connection_method": "router"}'
# Set bot service to hybrid mode (balanced performance)
curl -X POST http://localhost:8004/services/bot_svc/connection-method \
-d '{"connection_method": "hybrid"}'
# Set AI service to REST mode (if using external AI)
curl -X POST http://localhost:8004/services/ai_svc/connection-method \
-d '{"connection_method": "rest"}'For better performance, configure Redis:
# Install Redis if not already installed
sudo apt install redis-server # Ubuntu/Debian
brew install redis # macOS
# Add to .env file
echo "REDIS_URL=redis://localhost:6379/0" >> .env
# Restart platform
python -m rssbot# Overall bot statistics
curl http://localhost:8004/services/bot_svc/stats
# Feed performance metrics
curl http://localhost:8004/services/db_svc/feeds/1/metrics
# Platform health
curl http://localhost:8004/health# Recent feed items
curl http://localhost:8004/services/db_svc/feeds/1/items?limit=10
# Processing statistics
curl http://localhost:8004/admin/stats/feeds
# Error logs (if any)
curl http://localhost:8004/admin/logs/bot_svc?level=ERROR# Add multiple feeds at once
curl -X POST http://localhost:8004/services/db_svc/feeds/bulk \
-H "Content-Type: application/json" \
-d '{
"feeds": [
{
"url": "https://rss.cnn.com/rss/edition.rss",
"title": "CNN News",
"chat_id": YOUR_USER_ID
},
{
"url": "https://feeds.bbci.co.uk/news/rss.xml",
"title": "BBC News",
"chat_id": YOUR_USER_ID
}
]
}'- Create a Telegram channel
- Add your bot as admin with post message permissions
- Get channel ID (starts with -100)
- Subscribe channel to feeds:
curl -X POST http://localhost:8004/services/db_svc/feeds \
-H "Content-Type: application/json" \
-d '{
"url": "https://feeds.feedburner.com/oreilly",
"title": "Tech News for Channel",
"chat_id": -1001234567890,
"update_interval": 1800
}'# Enable duplicate detection
curl -X PUT http://localhost:8004/services/db_svc/feeds/1 \
-d '{"duplicate_detection": true}'
# Enable content filtering
curl -X PUT http://localhost:8004/services/db_svc/feeds/1 \
-d '{"content_filter": ["technology", "programming"]}'
# Enable scheduled posting
curl -X PUT http://localhost:8004/services/db_svc/feeds/1 \
-d '{"scheduled_posting": true, "posting_hours": [9, 12, 15, 18]}'# Check bot service health
curl http://localhost:8004/services/bot_svc/health
# Restart bot service if needed
curl -X POST http://localhost:8004/services/bot_svc/restart# Check channel manager service
curl http://localhost:8004/services/channel_mgr_svc/status
# Manually trigger feed processing
curl -X POST http://localhost:8004/admin/feeds/process-all- Ensure bot is admin in channels
- Check bot token is valid
- Verify chat IDs are correct
Congratulations! You now have a working RSS bot. Here's what you can do next:
- 📱 Add More Features - Custom commands and handlers
- 🎨 Customize Templates - Advanced message formatting
- 🧠 Enable AI Features - Content enhancement and summarization
- 🚀 Production Deployment - Deploy for real users
- 🐳 Docker Setup - Containerized deployment
- 📊 Monitoring Setup - Performance tracking
- 💳 Payment Integration - Subscription management
- 👥 User Management - Advanced user features
- 📈 Analytics - Usage analytics and insights
🎉 Amazing! You've successfully created your first RSS bot with RssBot Platform. Start exploring the advanced features to make it even more powerful! 🚀