discord-repost-history-bot

discord-repost-history-bot

Docker app from CatDuck's Repository

FeverDream is a Discord bot that copies messages from one Discord server to another.

Requirements

Appdata path must be owned by UID/GID 1000. Before the first start, run: chown -R 1000:1000 /mnt/user/appdata/discord-repost-history-bot
Overview

FeverDream is a Discord bot that copies messages from one Discord server to another. With /link-add it live-forwards every new message from a source channel to a target channel, preserving the original author's name and avatar through a "FeverDream Relay" webhook. With /repost-history it bulk-reposts a channel's whole history into a target channel, oldest first, with live progress status (/repost-status, /repost-stop). With /broadcast it sends one message to many channels at once. Channel links are stored in the Appdata folder and persist across restarts; running repost jobs are kept in memory only and do not resume after a restart.

There is no Web UI and no port to open.

SETUP, in order:

  1. Go to the Discord Developer Portal (https://discord.com/developers/applications), create a New Application named FeverDream, open the Bot section, click Reset Token and copy the Bot Token.
  2. In the same Bot section, enable the MESSAGE CONTENT INTENT under Privileged Gateway Intents.
  3. In OAuth2, URL Generator, check the scopes bot and applications.commands and the bot permissions Send Messages, Manage Webhooks, Read Message History, View Channels, Attach Files and Embed Links. Open the generated URL and invite the bot to BOTH the source and the target server.
  4. Before the first start, run in the Unraid terminal: chown -R 1000:1000 /mnt/user/appdata/discord-repost-history-bot (the container runs as UID/GID 1000 and must be able to write its data folder).
  5. Set the Discord Bot Token below and start the container. Commands: /link-add, /link-remove, /link-list, /repost-history, /repost-status, /repost-stop, /broadcast.

🇬🇧 English | 🇨🇿 Přečíst česky

FeverDream

A Discord bot for reposting messages (text, photos, videos and other attachments) from one Discord server to another, sending bulk messages, and reporting its own progress via status messages.

This bot was originaly created for copy pasted whole channel from one dc server to anther.

Contents

  1. Language & technology choice
  2. Architecture
  3. How the bot works
  4. Commands
  5. Installation & running the bot
  6. Setting up the bot on Discord
  7. Limitations & notes

1. Language & technology choice

Python 3.11+ with the discord.py library was chosen as the implementation language.

Reasons:

  • discord.py is the most mature and best-documented library for writing Discord bots — it natively supports slash commands, webhooks, attachments, rate-limit handling and asynchronous processing (asyncio), which is essential for a bot that has to bulk-repost hundreds or thousands of messages with attachments.
  • Python allows for fast development and easy maintenance, even for people who aren't experts in low-level network programming.
  • Alternatives (Node.js + discord.js, Java + JDA) are comparably capable, but Python/discord.py has the simplest API specifically for working with attachments (Attachment.to_file()) and webhooks, which this bot relies on as its core technique for preserving the original author's name and avatar when reposting.

2. Architecture

reposting_bot/
├── bot.py                # entry point, bot initialization, on_message listener
├── core/
│   ├── config.py         # loads configuration from .env
│   ├── storage.py        # JSON persistence for channel links
│   ├── forwarder.py      # logic for forwarding a single message (webhook, attachments)
│   └── jobs.py           # tracking of running repost jobs (history reposting)
├── cogs/
│   ├── linking.py        # /link-add, /link-remove, /link-list
│   ├── repost.py         # /repost-history, /repost-status, /repost-stop
│   └── broadcast.py      # /broadcast
├── data/
│   └── links.json        # (created at runtime) stored channel links
├── requirements.txt
├── .env.example
├── README.md              # this English documentation (main)
└── README.cs.md           # Czech documentation

Key components:

  • core/forwarder.py — the forwarding core. For the target channel it finds or creates a webhook named FeverDream Relay and sends the message through it so that it appears in the target channel as if it had been written by the original author (same name and avatar). Attachments (photos, videos, files) are downloaded and re-uploaded (Attachment.to_file()), so they keep working even after the original message is gone.
  • core/storage.py — persistent "source channel → target channel" links for live forwarding of new messages. Stored in data/links.json, so links survive a bot restart.
  • core/jobs.py — tracks running bulk history-repost jobs (progress, file count, cancellation).
  • bot.py — listens for on_message. If a message comes from a channel configured as the source of a link, it is immediately forwarded to the target channel. Messages sent through the bot's own relay webhook are ignored, to avoid an infinite loop.

3. How the bot works

The bot distinguishes between two forwarding modes:

a) Live forwarding (link)

An administrator sets up a link once with /link-add, between a source channel (on the current server) and a target channel (on any server the bot is also a member of). From that point on, the bot automatically forwards every new message (text, photo, video, attachment) from the source to the target, with no further action needed.

b) Bulk history repost (repost-history) — optional, off by default

Since 0.0.1 this mode is disabled by default, so the bot only forwards messages posted going forward. To turn it on, set ENABLE_HISTORY_REPOST=true and restart the bot; the three commands below are then registered again. While it is off, /repost-history, /repost-status and /repost-stop do not exist in Discord.

With /repost-history, the bot walks through the entire existing history of a given channel (or only the last N messages, if a limit is given) and reposts it into the target channel in the same order it was originally written (oldest first). While running, the bot continuously updates its own "status" message with the current number of processed messages and forwarded files, and once finished it updates that message into a final report: "Repost finished — the job is done!" along with a summary (message count, file count, duration). The job can be stopped at any time with /repost-stop.

c) Bulk messages (broadcast)

With /broadcast you can send the same message (optionally with one attachment) to any number of channels at once — e.g. an announcement posted to multiple servers/channels simultaneously. Once done, the bot sends a status summary (how many channels succeeded/failed).

Between individual sends, the bot waits a short delay (SEND_DELAY_SECONDS in core/config.py) so it doesn't run into Discord rate limits when sending a large number of messages or attachments.

4. Commands

All commands are implemented as slash commands (/...). Commands marked with 🔒 require the Manage Guild permission. The three /repost-* commands are only available when ENABLE_HISTORY_REPOST=true (see section 3b).

Command Description
🔒 /link-add source:#channel target_channel_id:ID Enables live forwarding of new messages from the source channel to the target channel (even on a different server). Only messages posted after the link is created are forwarded; history is not copied.
🔒 /link-remove source:#channel Disables live forwarding for the given source channel.
/link-list Lists all active links for the current server.
🔒 /repost-history source:#channel target_channel_id:ID [limit] Reposts message history (all, or the last limit messages) into the target channel. Shows live and final status updates.
/repost-status Shows the status (running/finished) of repost jobs on the server.
🔒 /repost-stop job_id:ID Stops a running repost job.
🔒 /broadcast message:text channel_ids:"id1,id2,..." [attachment] Sends a bulk message (optionally with an attachment) to multiple channels at once.

Note on target_channel_id: Discord's "channel"-type slash command parameters only allow picking a channel from the current server. Since the bot needs to forward between servers, the target channel is given as a numeric ID instead (Developer Mode → right-click the channel → "Copy Channel ID"). The bot must be a member of the target server with the Manage Webhooks and Send Messages permissions.

5. Installation & running the bot

Requirements

Steps

  1. Create an application and a bot on the Discord Developer Portal (see section 6 below) and get its Bot Token.

  2. Clone/copy the project and open a terminal in the reposting_bot folder.

  3. Create a virtual environment and install dependencies:

    python -m venv .venv
    .venv\Scripts\activate
    pip install -r requirements.txt
    
  4. Set up configuration — copy .env.example to .env and fill in the token:

    copy .env.example .env
    

    Open .env and set:

    DISCORD_TOKEN=your-bot-token
    DEV_GUILD_ID=
    

    DEV_GUILD_ID is an optional server ID used to sync slash commands instantly during development (otherwise a global sync can take up to about an hour to propagate).

  5. Run the bot:

    python bot.py
    

    The console should show Logged in as FeverDream#....

  6. Invite the bot to the servers where it should forward messages (see section 6) — the bot must be a member of both servers (source and target).

6. Setting up the bot on Discord

  1. Go to https://discord.com/developers/applications → New Application → name it FeverDream.
  2. In the Bot section, click Reset Token and copy the token into .env (DISCORD_TOKEN).
  3. In the same Bot section, enable the Privileged Gateway Intents:
    • MESSAGE CONTENT INTENT (required to read message text and attachments).
  4. In OAuth2 → URL Generator, check:
    • Scopes: bot, applications.commands
    • Bot Permissions: Send Messages, Manage Webhooks, Read Message History, View Channels, Attach Files, Embed Links
  5. Open the generated URL in a browser and invite the bot to both the source and target server.
  6. On both servers, grant the bot access to the channels it needs to forward between (double-check that no channel-specific permission overwrite denies it View Channel / Read Message History).

7. Limitations & notes

  • Discord enforces an attachment size limit depending on the server's boost level (typically 25 MB, more for boosted servers). If an attachment doesn't fit in the target channel, the bot sends the message text without it and adds a note that the attachment was too large.
  • Live forwarding only handles messages created after the link was made. Messages posted before the link exists are never copied.
  • Both live forwarding and bulk history repost send messages under the original author's name and avatar via a webhook — so it's technically a copy, not a true Discord "forward", but it visually and content-wise matches the original.
  • Channel links (/link-add) are stored in data/links.json and survive a bot restart. Running repost jobs (/repost-history) are not resumed after a restart — they need to be started again.
  • For large channels (thousands of messages), /repost-history can take a while to finish due to the delay between messages (protection against Discord rate limits).

8. Running with Docker

A prebuilt image is published to the GitHub Container Registry:

docker pull ghcr.io/catduckgnaf/discord-repost-history-bot:latest

The image is built for linux/amd64 and linux/arm64. It has no Web UI and opens no ports.

Setup

  1. Create the application and bot in the Discord Developer Portal and finish the Discord setup in section 6 above: copy the Bot Token, enable MESSAGE CONTENT INTENT, and invite the bot to both the source and target servers with the scopes bot and applications.commands and the permissions Send Messages, Manage Webhooks, Read Message History, View Channels, Attach Files, and Embed Links.

  2. Prepare the data folder. The container runs as UID/GID 1000, so the folder must be owned by that user:

    mkdir -p data
    chown -R 1000:1000 data
    

    On Unraid the equivalent is:

    chown -R 1000:1000 /mnt/user/appdata/discord-repost-history-bot
    
  3. Run the container, passing the token as an environment variable:

    docker run -d \
      --name discord-repost-history-bot \
      --restart unless-stopped \
      -e DISCORD_TOKEN=your-bot-token \
      -v "$PWD/data:/app/data" \
      ghcr.io/catduckgnaf/discord-repost-history-bot:latest
    

    Or use the included docker-compose.yml: put DISCORD_TOKEN (and optionally DEV_GUILD_ID) in a .env file next to it, then run docker compose up -d.

Configuration

Variable Required Description
DISCORD_TOKEN Yes Bot token from the Discord Developer Portal. The container exits immediately if this is empty.
DEV_GUILD_ID No When set, slash commands sync instantly to just this server. Leave empty for global sync (can take up to about an hour).
ENABLE_HISTORY_REPOST No Default false. Set to true to register the bulk history commands (/repost-history, /repost-status, /repost-stop). Leave off to forward only messages posted going forward.
TZ No Container timezone, used for log timestamps.

Channel links are stored in /app/data/links.json inside the mounted folder and survive restarts. Running repost jobs are kept in memory only and do not resume after a restart.

An Unraid Community Apps template for this image is available in catduck's Unraid templates.

Categories

Related apps

Explore more like this

Explore all

Links

Details

Repository
ghcr.io/catduckgnaf/discord-repost-history-bot:latest
Last Updated2026-11-16
First Seen2026-11-15

Runtime arguments

Network
bridge
Shell
sh
Privileged
false

Template configuration

Appdata StoragePathrw

Persistent storage for the bot's channel links (data/links.json), so links survive restarts. This folder must be owned by UID/GID 1000: chown -R 1000:1000 /mnt/user/appdata/discord-repost-history-bot

Target
/app/data
Default
/mnt/user/appdata/discord-repost-history-bot
Value
/mnt/user/appdata/discord-repost-history-bot
Discord Bot TokenVariable

Bot token from the Discord Developer Portal (your application, Bot section, Reset Token). The container exits immediately if this is empty.

Target
DISCORD_TOKEN
Dev Guild ID (optional)Variable

Optional server (guild) ID. When set, slash commands sync instantly to just this server. Leave empty for global sync, which can take up to about an hour.

Target
DEV_GUILD_ID
Container TimezoneVariable

IANA timezone for the container's local time (e.g. America/New_York, Europe/London, America/Chicago). Controls log timestamps.

Target
TZ
Default
America/New_York
Value
America/New_York