Skip to content

lilka-dev/rss_feeder_discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord News Fetcher

One-shot CLI that pulls recent Discord messages, normalizes them, and exports JSON + RSS. It is not a server, web app, or long-running bot; it runs once, writes files, and exits.

What it does

  • Connects to Discord with a bot token
  • Reads channel history (no event listeners)
  • Normalizes messages into a consistent schema
  • Exports to output/news.json and output/news.xml by default

What it is not

  • No web UI
  • No database or persistent service
  • No background worker or on_message listener

Requirements

  • Python 3.10+
  • Discord bot token with permission to read target channels
  • Environment variables configured (see below)

Installation

python -m venv .venv
source .venv/bin/activate
pip install -e .

Configuration

All settings come from environment variables (no prompts):

  • DISCORD_BOT_TOKEN (required)
  • DISCORD_CHANNEL_IDS (required, comma-separated IDs)
  • MESSAGES_LIMIT (optional, default 50, max 200; per channel)
  • OUTPUT_JSON_PATH (default output/news.json)
  • OUTPUT_RSS_PATH (default output/news.xml)
  • SITE_BASE_URL (optional, used for RSS <link>)
  • FEED_TITLE / FEED_DESCRIPTION (optional RSS metadata)
  • FEED_LANGUAGE (default en)

Example .env:

DISCORD_BOT_TOKEN=your-bot-token-here
DISCORD_CHANNEL_IDS=123456789012345678,987654321098765432
MESSAGES_LIMIT=50
OUTPUT_JSON_PATH=output/news.json
OUTPUT_RSS_PATH=output/news.xml
SITE_BASE_URL=https://example.com
FEED_TITLE=Community Updates
FEED_DESCRIPTION=Latest posts from our Discord
FEED_LANGUAGE=en

Running locally

export DISCORD_BOT_TOKEN=...
export DISCORD_CHANNEL_IDS=123456789012345678,987654321098765432
python -m discord_fetcher.cli

Optional overrides:

python -m discord_fetcher.cli --limit 100 --json-path data/discord.json --rss-path data/discord.xml

GitHub Actions usage

- name: Fetch Discord news
  run: python -m discord_fetcher.cli
  env:
    DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
    DISCORD_CHANNEL_IDS: ${{ secrets.DISCORD_CHANNEL_IDS }}
    MESSAGES_LIMIT: 50

Output

  • JSON: array of normalized messages (newest first), UTF-8, indent=2, ensure_ascii=False.
  • RSS: RSS 2.0 feed capped at 50 newest items, UTF-8 XML.

Notes

  • Bot messages are skipped.
  • Attachments are exported as links only.
  • The tool exits after writing output files; no listeners remain active.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages