-
Notifications
You must be signed in to change notification settings - Fork 617
Slack bot setup
Slack's model for bot users and other third-party integrations revolves around Slack Apps. They have been around for a while and are the only and default way of integrating services like Matterbridge going forward.
Slack Docs: Bot user tokens
-
Navigate to your Apps page. You'll need to be logged in with an account that has administrative permissions over the Slack Workspace (server) that you want to sync with Matterbridge.
-
Click on the
Create App
button and fill in the app's name and select the right Slack Workspace before validating. -
Navigate to the
Bot Users
page via the menu on the left side of the page. Click on theAdd a Bot User
, fill in the bot's details and validate to create the required bot.
Now that we have a bot we need to give your new Slack App (and thus the bot) the right permissions on your Slack Workspace.
-
Via the menu on the left side of the page navigate to the
OAuth & Permissions
page and scroll down to theScopes
section. -
Successively add the following permission scopes to your app:
- Modify your public channels (
channels:write
) - Send messages as <App name> (
chat:write:bot
) - Send messages as user (
chat:write:user
) - Access user’s profile and workspace profile fields (
users:profile:read
)
Click on the
Save changes
button below the scopes once all scopes have been added. - Modify your public channels (
-
Scroll to the top of the same
OAuth & Permissions
page and click on theInstall App
(orReinstall App
) button. This will give a pop-up menu summarising the permission scopes that you just added and will ask for your confirmation to add the new App with its bot to your Workspace. -
Once the App has been installed the top of the
OAuth & Permissions
page will show two tokens: anOAuth Access Token
starting withxoxp-...
and aBot User OAuth Access Token
starting withxoxb-...
. You will need to use the second in your Matterbridge configuration.
The only thing that remains now is to set up the newly created bot on the Slack Workspace itself.
-
On your Slack server you need to add the newly created bot to the relevant channels. Simply use the
/invite @<botname>
command in the chatbox. -
Repeat the invite process for each channel that Matterbridge needs to sync.
Now you are all set to go. Just configure and start your Matterbridge instance and see the messages flowing.
🛑 This setup is not recommended and will disappear in future versions of Matterbridge. Please use it only if you are absolutely sure that you can not use the normal setup. Legacy tokens are, as their name indicates, a legacy feature and Slack can in the future deprecate them at short notice as they have a weak security model and give access to a wide-range of privileged actions. Always store your token securely!
Slack Docs: Legacy tokens
In order to use this setup your channel configuration should use the slack-legacy
setup instead of slack
:
[slack-legacy]
[slack-legacy.myslack]
Token="xoxp-123456789-mytoken"
Steps to follow:
-
First create a dedicated user (a new account specifically for the bot) in Slack.
-
Next log in as this user and go to the legacy tokens page and click "Create token" for your team and your new user. The token will look something like
xoxp-123456789-LowerAndUPpercase
. -
Use the obtained token in your configuration file for the channel setup as in the example above.
Getting started
How to create your config
Discord bot setup
Slack bot setup
MS Teams setup
Deploy
DigitalOcean
Azure
Docker
Heroku
Gateways
Config: basic
Config: channel rules
Discord
Gitter
Hipchat
IRC
Keybase
Matrix
Mattermost
Microsoft Teams
Mumble
Nextcloud Talk
RocketChat
Slack
Sshchat
Steam
Telegram
Twitch
VK
WhatsApp
XMPP
Zulip
Advanced
Mediaserver setup
Service files
Developer
API
Tengo scripting
Making gateways