Skip to main content
Project

Discord RSS Bot

Automated bot that monitors RSS feeds and posts updates to Discord channels via webhook. Fully configurable with custom feeds and categories. Features timeout handling to prevent hanging on slow RSS feeds.

Cover image for Discord RSS Bot

About Discord RSS Bot

Discord RSS Bot is an automated bot that monitors RSS feeds and posts updates to Discord channels via webhook. Fully configurable with custom feeds and categories, it features timeout handling to prevent hanging on slow RSS feeds.

Key Features

  • Automatic RSS monitoring with configurable intervals
  • Elegant Discord formatting with category emojis
  • Smart caching to prevent duplicate posts
  • Timeout handling prevents hanging on slow feeds
  • Robust error handling for network issues
  • Fully containerized with Docker support
  • Pre-built images available on Docker Hub & GHCR
  • Multi-platform (AMD64, ARM64)
  • Flexible configuration - universal or category-based feeds
  • Multiple deployment options (Docker, System Service)
  • Comprehensive logging and health checks
  • Security-focused with non-root containers

Quick Start

# Create directories for persistent data/logs
mkdir -p ~/docker/docker-data/rss-discord-bot/data
mkdir -p ~/docker/docker-data/rss-discord-bot/logs

# Set permissions for container access (container runs as non-root)
chmod 777 ~/docker/docker-data/rss-discord-bot/logs
chmod 777 ~/docker/docker-data/rss-discord-bot/data

# Create .env file with your webhook URL (do not commit this file)
echo "DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR_ID/YOUR_TOKEN" > .env

# Run with Docker Compose (for testing with pre-built image)
docker compose -f docker-compose.test.yml up -d

# View logs
docker compose -f docker-compose.test.yml logs -f

Container Images

Pre-built images are available from multiple registries:

  • Docker Hub: isyuricunha/discord-news-rss-bot:latest | isyuricunha/discord-news-rss-bot:2.0.8
  • GitHub Container Registry: ghcr.io/isyuricunha/discord-news-rss-bot:latest | ghcr.io/isyuricunha/discord-news-rss-bot:2.0.8

Supported Architectures

  • linux/amd64 (x86_64)
  • linux/arm64 (ARM64/AArch64)

Automatic Versioning

The project uses automated CI/CD that:

  • Auto-creates Git tags on every push to main (e.g., v2.0.8)
  • Creates a GitHub Release for each tag
  • Uses the triggering commit message as the release title and body
  • Publishes to both registries simultaneously
  • Maintains version consistency across Docker Hub and GHCR
  • Updates both latest and specific version tags

Deployment Options

1. Standard Docker Compose (with .env file)

docker compose up -d

2. Inline Environment Variables

# Edit docker-compose.inline.yml with your webhook URL
docker compose -f docker-compose.inline.yml up -d

3. Pre-built Image (from .env file)

# Edit docker-compose.prebuilt.yml and configure .env file
docker compose -f docker-compose.prebuilt.yml up -d

4. Testing with All Default Feeds

# Use the test configuration with all feeds pre-configured
# Edit webhook URL in docker-compose.test.yml first
docker compose -f docker-compose.test.yml up -d

System Service Installation

For production deployments, you can install the bot as a system service:

Debian/Ubuntu

sudo ./scripts/install-debian.sh --webhook-url "YOUR_WEBHOOK_URL"
sudo systemctl start discord-news-rss-bot

Fedora/RHEL/CentOS

sudo ./scripts/install-fedora.sh --webhook-url "YOUR_WEBHOOK_URL"
sudo systemctl start discord-news-rss-bot

Alpine Linux

sudo ./scripts/install-alpine.sh --webhook-url "YOUR_WEBHOOK_URL"
sudo rc-service discord-news-rss-bot start

Windows

# Run as Administrator
.\windows\install.ps1 -WebhookUrl "YOUR_WEBHOOK_URL"
net start DiscordRSSBot

Configuration

Required Variables

VariableDescription
DISCORD_WEBHOOK_URLRequired: Discord webhook URL
VariableDefault (Docker image)Description
RSS_BOT_DATA/app/dataDirectory where the SQLite database is stored
RSS_BOT_LOGS/app/logsDirectory where log files are written
RSS_BOT_PID/tmp/discord-news-rss-bot.pidPID file path (avoid /var/run in non-root containers)

Advanced overrides (optional)

VariableDescription
DB_FILEExplicit SQLite DB file path (overrides RSS_BOT_DATA)
LOG_FILEExplicit log file path (overrides RSS_BOT_LOGS)
DATA_DIRLegacy alias for RSS_BOT_DATA

Optional Bot Settings

VariableDefaultDescription
CHECK_INTERVAL300Interval between checks (seconds)
POST_DELAY3Delay between posts (seconds)
COOLDOWN_DELAY60Delay after rate limit (seconds)
MAX_POST_LENGTH1900Maximum message length
MAX_CONTENT_LENGTH800Maximum content length
FEED_TIMEOUT30RSS feed request timeout (seconds)

RSS Feeds Configuration

The bot supports two configuration methods with automatic priority handling:

Option 1: Universal Feeds (Simple)

Use a single variable for all your RSS feeds:

RSS_FEEDS=https://example.com/rss,https://another.com/feed,https://third.com/rss

Option 2: Category-Based Feeds (Organized)

Use separate variables for different categories:

RSS_FEEDS_NEWS=https://g1.globo.com/dynamo/rss2.xml,https://rss.uol.com.br/feed/noticias.xml
RSS_FEEDS_TECHNOLOGY=https://canaltech.com.br/rss/,https://tecnoblog.net/feed/
RSS_FEEDS_SPORTS=https://globoesporte.globo.com/rss/ultimas/
RSS_FEEDS_BUSINESS=https://www.infomoney.com.br/rss/
RSS_FEEDS_POLITICS=https://www.gazetadopovo.com.br/rss/brasil.xml

Priority System

  1. RSS_FEEDS (universal) - takes priority if set
  2. RSS_FEEDS_CATEGORY (categories) - used if no universal feeds
  3. Default feeds - Brazilian news feeds if no custom configuration

Automatic Category Emojis

  • News/Noticias/General โ†’ ๐Ÿ“ฐ
  • Technology/Tecnologia โ†’ ๐Ÿ’ป
  • Politics/Politica โ†’ ๐Ÿ›๏ธ
  • Sports/Esportes โ†’ โšฝ
  • Business/Economia โ†’ ๐Ÿ’ผ
  • Other categories โ†’ ๐Ÿ“ข

Monitored Feeds

๐Ÿ“ฐ General News

  • G1
  • UOL
  • Band
  • CNN Brasil
  • Folha de S.Paulo

๐Ÿ›๏ธ Politics & Conservative

  • Gazeta do Povo
  • Jovem Pan
  • Diรกrio do Poder
  • Pragmatismo Polรญtico
  • Conexรฃo Polรญtica
  • Poder 360
  • Revista Crusoรฉ
  • Veja
  • Metrรณpoles
  • O Antagonista
  • Terra Politics

๐Ÿ’ป Technology

  • Canaltech
  • Olhar Digital
  • Tecnoblog
  • Meio Bit
  • ShowMeTech
  • TecMundo
  • Adrenaline
  • Hardware.com.br
  • Tudo Celular
  • Oficina da Net

Development

Run Locally (without Docker)

# Install dependencies
pip install -r requirements.txt

# Configure environment variables
export DISCORD_WEBHOOK_URL="your_webhook_url_here"

# Run the bot
python bot_service.py

Customize Feeds

You can customize feeds in two ways:

  1. Environment Variables (Recommended) Use the RSS_FEEDS_CATEGORY_NAME format as described in the Configuration section above.

  2. Code Modification Edit the parse_feeds_from_env() function in bot_service.py to modify default feeds.

Technology Stack

  • Python for the main bot logic
  • Discord webhooks for posting updates
  • Docker for containerization and deployment
  • SQLite for data persistence and caching
  • RSS parsing for feed monitoring
  • Systemd for Linux service management

Discord RSS Bot is a complete solution for automatically posting RSS feed updates to Discord channels, with robust error handling, flexible configuration, and multiple deployment options.