Workflow to open Slack channels and contacts without having to obtain an OAuth token.
The plugin uses Slack Deep Linking.
- Download the Workflow (alfred_slack.alfredworkflow)
- Double click to install
- Create a
.alfred-slack.json
in your user home directory.
[
{
"team": "myTeam",
"teamId": "ABCDEFG",
"channels": [
{
"name": "#some-channel",
"id": "ABCDEFGH"
},
{
"name": "@some-user",
"id": "DEFGHIJK"
}
]
}
]
A name
only refers to some viewable text. For displaying, only
the IDs are relevant. You can obtain them by opening up the Slack web client
and then switching through channels and users. Note how the URL changed. The static
ID part is the teamId, the variable one is the channel id.
As soon you have created an initial .alfred-slack.json
, updating becomes quite
cumbersome. To ease the process there are two utility scripts to help you update the content.
This approach will update your .alfred-slack.json
using all channels and users
in your workspace. Problem about this is that you need an installed Slack app
with channels.read
and users.read
permissions. A normal user does not have those permissions.
But in case you do - follow this approach for both updating channels and users.
- You need to get the actual available via the Slack API tester (users and channels). Execute the respective query and copy the content (for each separate) to a top level
list-response.json
. - Run
npm run mergeAlfredSlackJsonWithSlackListFromApiTester
to get it merged to your.alfred-slack.json
.
This is the more generic approach. However, it will only put users and channels to your .alfred-slack.json
that is actually visible on the page. In case you want a specific users, make sure it is visible on the web page.
Afterwards, open up your Slack workspace in the browser and copy the HTML source code to a top level slack.html
.
Then run npm run mergeAlfredSlackJsonChannelInfoFromHtml
to get it merged to your .alfred-slack.json
.