A bridge that links Discord channels with Slack channels.
You can watch the demo video here!
- Forward messages between Discord and Slack
- Reupload files
- Username and avatar matching
-  Management commands
-  Discord /link,/unlink,/connect,/disconnect
-  Slack /link,/unlink,/connect,/disconnect
 
-  Discord 
- Formatting (almost done, some minor bugs)
- Create threads
- Forward reactions
- More features??
- You must be a Hack Clubber in the Hack Club Slack.
- Join my Discord server (the invite is in the #disclack channel on Slack).
- Head to the #slack-verifychannel and use the/linkcommand to link your Slack account.
- Send messages in the #disclack-connectchannel on Discord or Slack, and see them appear on the other platform!
- Use the /connectand/disconnectcommands to connect and disconnect channels. (Please don't mess up my server though...)
You might not need to self-host - you can invite the bot to another server, and it will Just Work™️! But if you do want to self-host, here's how you can host your own copy of the bot:
- Create an app on the Discord Developer Portal.
- On the "Installation" tab, in the "Default Install Settings" section at the bottom, choose the application.commandsandbotscopes, and the following permissions:- Add Reactions: Used to forward reactions (not implemented yet).
- Manage Roles: Used to add a role when a user links their Slack account (optional).
- Manage Webhooks: Used to create a webhook, which can set a custom username and avatar (bots can't do that).
- Attach Files,- Read Message History,- Send Messages,- Create Public Threads,- Send Messages in Threads,- View Channels: Should be self-explanatory.
 
- Copy the Discord Provided Install Link and open it to install the bot on a server on which you have the Manage Server permission.
- On the "Bot" tab, click "Reset Token" and save the bot token that appears.
- Create an app on the Slack API website.
- On the "Socket Mode" tab, turn on "Enable Socket Mode" which will prompt you to generate an app-level token. Make sure you save this.
- On the "Event Subscriptions" tab, turn on "Enable Events", and choose the following under "Subscribe to bot events":
- message.channel,- message.groups: Listen to messages in public and private channels.
- reaction_added,- reaction_removed: Listen to reaction events (not used yet).
 
- On the "OAuth & Permissions" tab, under "Bot Token Scopes", add the following scopes (in addition to the ones already there):
- channels:join: Join public channels when connected.
- channels:read,- groups:read,- users:read,- users.profile:read: Read info (mostly names) of public channels, private channels, and users.
- chat:write,- chat:write.customize: Send messages and use custom avatars and usernames.
- files:read,- files:write: Download and send files.
- im:write: DM users to verify their linking requests.
- reactions:write: Add reactions (not used yet).
 
- Refresh the page, and on the top of the screen, click the "Install to (Slack team name)" button. Save the "Bot User OAuth Token" after you complete the OAuth flow.
- Clone this repository and copy .env.exampleto.env.local. Change the values from the defaults. (See the example file for more details)
- Run bun iandbun index.tsto start.
If all goes well, you should see "Slack started!" and "Discord started!" among other lines of output. Now you can use the commands to link your accounts, connect channels, and have fun :yay:
This project uses Bun, the best JS runtime, package manager, testing framework, and well, in general the best. It makes so many things so much easier.
Discord.js was used to interface with Discord's API, and Slack's official Bolt for Javascript was used to interact with Slack.