A discord bot for copying messages between guilds
Current version: v3.1.0
Download the JAR from the releases page.
- Create an application on Discord's developer portal: https://discord.com/developers/applications/
- Create a bot for this application
- Enable the
MESSAGE CONTENT
privileged gateway intent. - Copy the bot token and pass it to the application via the
DISCORD_TOKEN
environment variable
In order for the bot to migrate messages it needs to be invited in both the source and destination guild, to do so you can use the following URL by replacing in your application ID (which can be found on the Discord developer portal)
https://discord.com/oauth2/authorize?client_id=<CLIENT-ID>&scope=bot
Pass the Discord bot token via environment variables.
- On linux and macOS open a terminal (bash) and simply prefix your command with the token as such:
DISCORD_TOKEN="MY_TOKEN_HERE" java -jar discord-transfer.jar [arguments...]
- On Windows you can use
powershell
. Define your environment variable and then run the program:
$env:DISCORD_TOKEN="MY_BOT_TOKEN_HERE"
java -jar discord-transfer.jar [arguments...]
The bot behaviour depends on the action
you select.
java -jar discord-transfer.jar <action> [options...] [arguments...]
In most cases you'll probably want to use the migrate
action to transfer messages,
but there is also the clean
action that removes the reactions used to mark migrated messages
java -jar discord-transfer.jar migrate [options...] <source> <destination>
The migrate action takes 2 arguments:
- The Discord ID (Snowflake) of the source Guild (the one you want to copy messages from)
- The Discord ID of the destination Guild (the one in which messages will be copied)
There are also options to customize the migration behavior:
--include-channel
: Specify channels that should be migrated, it's category will automatically be created if missing, expects a Discord channel ID--category
: Specify specific channel categories to migrate, expects a Discord category ID--skip-channel
: Specify channels that should not be migrated, expects a Discord channel ID--text-only
: Will only migrate text channels (skips voice channel creation)--after
: Only migrate messages after the give date (format ISO-8601, ex:1997−07−16T19:20:30,451Z
)--delay
: Add a delay between each message migration
Example: java -jar discord-transfer.jar migrate 123456789 987654321 --skip-channel 741852963
java -jar discord-transfer.jar clean [options...] <server>
The clean action takes a single argument, the Discord ID (Snowflake) of the Guild you want to clean reactions from.
If this README does not provide the information you are looking for, try running the help
action.
This bot uses Discord4J as a bot library.