Skip to content

Replicate messages from server A to server B on Discord via webhooks using a user token

Notifications You must be signed in to change notification settings

ivan-grebe/discord-message-replicator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Discord Message Replicator

A Discord self-bot that forwards messages from monitored channels to webhooks.

WARNING: Running self-bots is against Discord TOS. Use this script at your own risk.

Features

  • Message Forwarding: Replicates messages to webhooks with original author name and avatar. Supports attachments, threads, gifs, etc.
  • Load Balancing Webhooks: Rotates through multiple webhooks to bypass webhook rate-limit for high traffic channels
  • Channel Routing: Supports routing different channel messages to different webhooks

Configuration

Edit the configuration section in replicator.py:

# Your Discord user token
TOKEN = 'your-token-here'

# Map source channel IDs to route tags
SOURCE_CHANNELS = {
    1234567890123456789: 'general',
    9876543210987654321: 'alerts',
}

# Map route tags to webhook URLs
# Use multiple webhooks for high-traffic channels (30 msg/min limit per webhook)
WEBHOOK_ROUTES = {
    'general': [
        'https://discord.com/api/webhooks/...',
        'https://discord.com/api/webhooks/...',  # optional backup
    ],
    'alerts': [
        'https://discord.com/api/webhooks/...',
    ]
}

Installation

# Remove conflicting packages first
pip uninstall discord discord.py -y

# Install discord.py-self (includes aiohttp)
pip install discord.py-self

Usage

python replicator.py

Troubleshooting

TypeError or AttributeError on startup

You likely have the regular discord.py installed alongside discord.py-self. They conflict because both use the discord module name.

Fix:

pip uninstall discord discord.py -y
pip install discord.py-self

401 Unauthorized or Improper token

Your user token is invalid or expired. Get a fresh token from Discord.

Messages not forwarding

  • Verify the channel ID is correct (enable Developer Mode in Discord settings)
  • Check that the webhook URL is valid
  • Ensure the account has access to the source channel

Notes

  • This is a self-bot that uses your personal Discord token
  • Webhook rotation helps avoid the 30 messages/minute rate limit
  • Thread messages from monitored channels are automatically forwarded
  • The bot tracks recent message IDs (up to 10,000) to properly handle thread starters

About

Replicate messages from server A to server B on Discord via webhooks using a user token

Topics

Resources

Stars

Watchers

Forks

Contributors