A Discord bot designed to migrate content from Slack to Discord channels. This bot was built for Makerspace Delft to facilitate their migration from Slack to Discord in 2023.
This bot provides two main sets of functionality:
- Slack Migration Tools: Commands to migrate messages, threads, and files from Slack to Discord with user information preservation
- Channel Management: Tools to create and manage channels and permissions within Discord
- Migrate public Slack channels to Discord
- Migrate private Slack channels to Discord
- Preserve conversation threads
- Migrate file attachments (up to 8MB per file)
- Preserve user names and profile pictures
- Format Slack messages for Discord compatibility
- Create text and voice channels
- Set channel visibility (public/private)
- Add and remove users from channels
- Organize channels in categories
- Role-based permission management
- Python 3.10+
- A Discord Bot Token
- A Slack API Token with permissions to read channels
- Clone the repository
git clone https://github.com/yourusername/slack-discord-migration-bot.git
cd slack-discord-migration-bot- Copy the sample environment file and fill in your tokens
cp .env.sample .env- Edit the
.envfile with your Discord and Slack tokens:
DISCORD_TOKEN=your_discord_bot_token
SLACK_TOKEN=your_slack_api_token
- Install required packages
pip install -r requirements.txt- Run the bot
python main.pyNote: Do not use production tokens in your local .env file when testing.
| Command | Description |
|---|---|
/sync |
Synchronize slash commands with Discord |
/migrate <channelid> [limit] [after] |
Migrate messages from a public Slack channel |
/migrateprivate <channelid> [limit] |
Migrate messages from a private Slack channel |
/ditto <name> <message> |
Send a message as another user (admin only) |
| Command | Description |
|---|---|
/createchannel <group> <name> [visibility] |
Create a text channel in a category |
/createvoicechannel <group> <name> [visibility] |
Create a voice channel in a category |
/addtotextchannel <channel> <user> |
Add a user to a text channel |
/removefromtextchannel <channel> <user> |
Remove a user from a text channel |
/addtovoicechannel <channel> <user> |
Add a user to a voice channel |
/removefromvoicechannel <channel> <user> |
Remove a user from a voice channel |
| Command | Description |
|---|---|
!ping |
Simple ping-pong response to check if the bot is running |
This bot includes configuration for deployment on Fly.io:
- Install the Fly.io CLI tools
- Set up a GitHub Actions workflow with your FLY_API_TOKEN
- Push to the main branch to automatically deploy
- This bot was built in 2023 and uses APIs that may have changed since then
- Discord and Slack APIs are subject to change, so some functionality may require updates
- File migration is limited to 8MB per file due to Discord's file size limits
- Profile pictures may occasionally be inconsistent due to API limitations
- The bot requires appropriate permissions in both Slack and Discord to function properly
This bot was created for Makerspace Delft to facilitate migration from Slack to Discord. It can be adapted for other communities with similar migration needs.