Skip to content

Commit fb7126f

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 fb7126f

File tree

1 file changed

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

1 file changed

+31
-20
lines changed

zulip/integrations/bridge_with_slack/README.md

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

33
This is a bridge between Slack and Zulip.
44

5+
> [!NOTE]
6+
> This setup requires at least Zulip version 10.0.
7+
58
## Usage
69

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

1528
### 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).
29+
30+
1. Go to the [Slack Apps menu](https://api.slack.com/apps) and open the same Slack app
31+
that you used to set up the Slack Webhook integration previously.
32+
33+
2. Navigate to the "OAuth & Permissions" menu and scroll down to the "Scopes"
34+
section in the same page. Make sure "Bot Token Scopes" includes: `chat:write`
35+
36+
3. Next, also in the same menu find and note down the "Bot User OAuth Token".
37+
It starts with "xoxb-..." and not "xoxp".
38+
39+
4. In the `slack` section of the `bridge_with_slack.py` configuration file, enter the bot
40+
name (e.g "zulip_mirror"), token (e.g xoxb-...), and the channel ID (note: must be ID,
41+
not name).
3142

3243
### Running the bridge
3344

0 commit comments

Comments
 (0)