e4984d607d4b8fcb844147715c6782c9090e9a03
Link Analyzer Bot - #remora
Analyzes links posted in #remora channel in real-time. Fetches content, creates summaries, and adds to Tududi inbox.
Setup
1. Install dependencies
pip install discord.py requests
2. Get Discord Bot Token
If you don't have a bot token:
- Go to https://discord.com/developers/applications
- Click "New Application"
- Name it "Link Analyzer" (or whatever)
- Go to "Bot" tab → "Add Bot"
- Copy the token
- Under OAuth2 → Scopes, select:
bot - Under Permissions, select:
Read Messages/View Channels,Send Messages,Read Message History - Go to the generated URL and add bot to your server
3. Set environment variables
export DISCORD_BOT_TOKEN="your_token_here"
export TUDUDI_API_URL="https://todo.dilain.com/api/v1"
export TUDUDI_API_KEY="tt_5e3ac7fc2bf5ae5162ebac5d1d66dcc2ff9d9d0ab343b9d3d4c5a7c439ef67f5"
export OPENCLAW_GATEWAY="http://127.0.0.1:18789"
export OPENCLAW_GATEWAY_TOKEN="your_gateway_token"
4. Run bot
python3 bot.py
Should see:
✅ Bot logged in as LinkAnalyzer#1234
📍 Watching channel #remora (1467557082583535729)
What it does
- Real-time monitoring - Listens to all messages in #remora
- Link detection - Extracts URLs from messages
- Content fetching - Downloads and analyzes page content
- Type detection - GitHub, Reddit, YouTube, TikTok, etc.
- Summary response - Replies with format:
📌 **Type**: Title - Tududi integration - Adds to inbox:
📌 Type: Title\n🔗 URL - History tracking - Saves to
tracker.json(all processed links)
Files
bot.py- Main Discord bottracker.json- History of all processed linksanalyze-links.sh- Old cron version (deprecated)
Tracking
All links are saved in tracker.json:
{
"links": [
{
"url": "https://...",
"title": "Article Title",
"type": "GitHub",
"author": "username",
"message_id": 123456,
"date": "2026-02-09T18:05:00",
"tududi": true
}
]
}
Running as service
To run permanently (e.g., on a VPS):
# Using screen
screen -S link-bot
python3 bot.py
# Or systemd service
# TODO: Add systemd unit file
Troubleshooting
Bot not seeing messages:
- Check DISCORD_BOT_TOKEN is correct
- Verify bot has "Read Message History" permission
- Make sure bot is in the server
Can't fetch links:
- Some sites block scrapers → error logged in response
- Timeouts after 5 seconds
Tududi not getting items:
- Check TUDUDI_API_KEY is set
- Verify API endpoint is reachable
Future enhancements
- Summarization with AI (use Haiku analysis)
- Tag suggestions based on content
- React with 👀 when processing
- Edit summary if analysis completes
- Support for media attachments
Description
Languages
Python
82.5%
Shell
17.5%