Skip to content

Commit 21c32b4

Browse files
committed
slack bridge: Update doc for the new webhook based Slack Bridge.
This commit updates the Slack Bridge doc, primarily guiding the user to use our Slack Webhook integration.
1 parent eb65f9f commit 21c32b4

File tree

1 file changed

+32
-20
lines changed
  • zulip/integrations/bridge_with_slack

1 file changed

+32
-20
lines changed

zulip/integrations/bridge_with_slack/README.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,44 @@
22

33
This is a bridge between Slack and Zulip.
44

5+
!!! warn ""
6+
7+
This setup requires at least Zulip version 10.0.
8+
59
## Usage
610

711
### 1. Zulip endpoint
12+
813
1. Create a generic Zulip bot, with a full name like `Slack Bot`.
9-
2. (Important) Subscribe the bot user to the Zulip stream you'd like to bridge your Slack
10-
channel into.
11-
3. In the `zulip` section of the configuration file, enter the bot's `zuliprc`
12-
details (`email`, `api_key`, and `site`).
13-
4. In the same section, also enter the Zulip `stream` and `topic`.
14+
15+
2. (Important) Subscribe the bot user to the Zulip channel you'd like to bridge
16+
your Slack channel into.
17+
18+
3. Create a [Slack webhook integration bot](https://zulip.com/integrations/doc/slack)
19+
to get messages from Slack to Zulip. Make sure to follow the additional instruction
20+
for setting up a Slack bridge.
21+
22+
4. In the `zulip` section of the `bridge_with_slack.py` configuration file, enter the
23+
**Generic bot's** `zuliprc` details (`email`, `api_key`, and `site`).
24+
25+
5. Moving over to the `channel_mapping` section, enter the Zulip `channel` and `topic`.
26+
Make sure that they match the same `channel` and `topic` you configured in steps 2
27+
and 3.
1428

1529
### 2. Slack endpoint
16-
1. Make sure Websocket isn't blocked in the computer where you run this bridge.
17-
Test it at https://www.websocket.org/echo.html.
18-
2. Go to https://api.slack.com/apps?new_classic_app=1 and create a new classic
19-
app (note: must be a classic app). Choose a bot name that will be put into
20-
bridge_with_slack_config.py, e.g. "zulip_mirror". In the process of doing
21-
this, you need to add oauth token scope. Simply choose `bot`. Slack will say
22-
that this is a legacy scope, but we still need to use it anyway. The reason
23-
why we need the legacy scope is because otherwise the RTM API wouldn't work.
24-
We might remove the RTM API usage in newer version of this bot. Make sure to
25-
install the app to the workspace. When successful, you should see a token
26-
that starts with "xoxb-...". There is also a token that starts with
27-
"xoxp-...", we need the "xoxb-..." one.
28-
3. Go to "App Home", click the button "Add Legacy Bot User".
29-
4. (Important) Make sure the bot is subscribed to the channel. You can do this by typing e.g. `/invite @zulip_mirror` in the relevant channel.
30-
5. In the `slack` section of the Zulip-Slack bridge configuration file, enter the bot name (e.g. "zulip_mirror") and token, and the channel ID (note: must be ID, not name).
30+
31+
1. Go to the [Slack Apps menu](https://api.slack.com/apps) and open the same Slack app
32+
that you used to set up the Slack Webhook integration previously.
33+
34+
2. Navigate to the "OAuth & Permissions" menu and scroll down to the "Scopes"
35+
section in the same page. Make sure "Bot Token Scopes" includes: `chat:write`
36+
37+
3. Next, also in the same menu find and note down the "Bot User OAuth Token".
38+
It starts with "xoxb-..." and not "xoxp".
39+
40+
4. In the `slack` section of the `bridge_with_slack.py` configuration file, enter the bot
41+
name (e.g "zulip_mirror"), token (e.g xoxb-...), and the channel ID (note: must be ID,
42+
not name).
3143

3244
### Running the bridge
3345

0 commit comments

Comments
 (0)