Image from HERE
This is a gateway between Discord and Slack. It allows you to send messages from Discord to Slack and vice versa.
npm i discord-slack-gateway
const { DiscordSlackGateway } = require('discord-slack-gateway');
const gateway = new DiscordSlackGateway({
slack: {
token: "...",
appToken: "...",
signingToken: "...",
channelId: "...",
webhookUrl: "...",
socketMode: true
},
discord: {
webhookUrl: "...",
channelId: "...",
apiToken: "..."
}
});
I highly recommend using socket mode for Slack. It is much faster than the Events API. Also, use environment variables for tokens and other sensitive data
signingToken - Slack signing token. Read https://api.slack.com/authentication/verifying-requests-from-slack
token - Slack bot token. Read https://api.slack.com/authentication/token-types
appToken - Slack app token. Read https://api.slack.com/authentication/token-types
channelId - Slack channel id to listen to
webhookUrl - Slack webhook url. Read https://api.slack.com/messaging/webhooks
socketMode - Socket mode is a new way for apps to be installed to workspaces. Read https://api.slack.com/apis/connections/socket
webhookUrl - Discord webhook url generated from post method in https://discohook.org/
channelId - Discord channel id to listen to
apiToken - Discord api token generated from https://discord.com/developers/applications