Skip to content

Commit 67c8034

Browse files
PieterCKtimabbott
authored andcommitted
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. With significant rewriting by tabbott.
1 parent ddc1dcc commit 67c8034

File tree

1 file changed

+40
-22
lines changed
  • zulip/integrations/bridge_with_slack

1 file changed

+40
-22
lines changed

zulip/integrations/bridge_with_slack/README.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,51 @@
11
# Slack <--> Zulip bridge
22

3-
This is a bridge between Slack and Zulip.
3+
This integration is a bridge with Slack, delivering messages from
4+
Zulip into Slack. It is designed for bidirectional bridging, with the
5+
[Slack integration](https://zulip.com/integrations/doc/slack) used to
6+
deliver messages from Slack into Zulip.
7+
8+
Note that using these integrations together for bidirectional bridging
9+
requires the updated version of the Slack integration included in
10+
Zulip 9.4+.
411

512
## Usage
613

714
### 1. Zulip endpoint
8-
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`.
15+
16+
1. Create a generic Zulip bot, with a full name like `Slack Bridge`.
17+
18+
2. [Subscribe](https://zulip.com/help/manage-user-channel-subscriptions#subscribe-a-user-to-a-channel)
19+
the bot user to the Zulip channel(s) you'd like to bridge with
20+
Slack.
21+
22+
3. Create a [Slack webhook integration bot](https://zulip.com/integrations/doc/slack)
23+
to get messages from Slack to Zulip. Make sure to follow the additional instruction
24+
for setting up a Slack bridge.
25+
26+
4. In the `zulip` section of the `bridge_with_slack_config.py`
27+
configuration file, the bot's `zuliprc` details (`email`,
28+
`api_key`, and `site`).
29+
30+
5. In the `channel_mapping` section, enter the Zulip `channel` and
31+
`topic` that you'd like to use for each Slack channel. Make sure
32+
that they match the same `channel` and `topic` you configured in
33+
steps 2 and 3.
1434

1535
### 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).
36+
37+
1. Go to the [Slack Apps menu](https://api.slack.com/apps) and open the same Slack app
38+
that you used to set up the Slack Webhook integration previously.
39+
40+
2. Navigate to the "OAuth & Permissions" menu and scroll down to the "Scopes"
41+
section in the same page. Make sure "Bot Token Scopes" includes: `chat:write`
42+
43+
3. Next, also in the same menu find and note down the "Bot User OAuth Token".
44+
It starts with "xoxb-..." and not "xoxp".
45+
46+
4. In the `slack` section of `bridge_with_slack_config.py`, enter the
47+
bot name (e.g "slack_bridge"), token (e.g xoxb-...), and the
48+
channel ID (note: must be ID, not name).
3149

3250
### Running the bridge
3351

0 commit comments

Comments
 (0)