Skip to content

rotten-ttc/Discord-Chat-Restorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Discord Chat Restorer

A migration utility that replays DiscordChatExporter JSON history into a Discord channel/thread using webhooks.

Features

  • Sends messages with original username/avatar via webhook identity override.
  • Adds date separator banners every N days.
  • Simulates replies by quoting referenced messages.
  • Simulates reactions in a footer line.
  • Appends attachment URLs to message content.
  • Handles webhook rate limits (429) with retry logic.
  • Supports checkpoint/resume so reruns avoid duplicate sends.
  • Logs non-retryable send failures to a file.
  • Supports dry-run mode.

Setup

python -m venv .venv
source .venv/bin/activate
pip install requests emoji

Usage

Set configuration through environment variables (recommended):

export JSON_FILE="general.json"
export WEBHOOK_URL="https://discord.com/api/webhooks/..."
export THREAD_ID=""                        # optional
export DAYS_BETWEEN_DATES="7"             # optional
export SLEEP_SECONDS="1.5"                # optional
export CHECKPOINT_FILE=".migration_checkpoint.json"
export ERROR_LOG_FILE=".migration_errors.log"
export DRY_RUN="false"                    # true = no network calls

python discord_migration.py

Security Notes

  • Do not commit live webhook URLs.
  • Treat webhook URL as a secret credential.
  • Rotate webhook immediately if exposed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors