Skip to content
Nihal Mirpuri edited this page Jan 27, 2016 · 15 revisions

Native Slack plugin

Installation

Requirements:

Note: This will only work for public Slack channels. Private groups and PM's will not work with this plugin

Setting up the Sink and Webhook

  • Create a self-signed certificate and when signing, be sure to put your internet-accessible server name or ip addresss (whichever is applicable) as the CN (Common Name) otherwise Slack will refuse to connect to the sink.

  • Install pyslack via pip3 install git+git://github.com/loisaidasam/pyslack.git

  • Install python emojis via pip3 install git+https://github.com/carpedm20/emoji

  • Set up your config.json as follows:

    "slack": [
      {
        "certfile": "YOUR_CERT_FILE",
        "name": "YOUR_SERVER_NAME",
        "port": "LISTENING_PORT",
        "key": "SLACK_API_KEY",
        "channel": "#SLACK_CHANNEL_NAME",
        "synced_conversations": ["CONV_ID1", "CONV_ID2"],
        "link_names": true,
        "otr_privacy": false,
        "multi_hooks": false
      }
    ]
    • certfile: The path to the .pem that you just self-signed
    • name: The name/ip address of your server
    • port: The port that the sink will listen on
    • key: your Slack API token
    • channel: The #channel that you want to sync to hangouts. Only public channels will work
    • synced_conversations: The conv_id of the conversation(s) that you want synced. If you supply more than one, be sure that the list of conversations are all synced together using the syncrooms plugin.
    • optional link_names: Make the Slackbot find and link all #channel and @username mentions from hangouts messages - this setting defaults to true if not set
  • Navigate to your Slack team and implement an Outgoing Webhook. Set up the Webhook according to the Slack instructions, with the URL pointing to: https://{SERVER_NAME}:{PORT}/{CONV_ID} where conv_id is the conversation that you want to forward messages to (if you're using a Syncout, just put any conv_id that's in the Syncout).

  • Make sure that everything works!

Commands

/bot slackusers - Will list the users of the channel who is synced to the current room.

Other Slack plugins

At the time of writing, there are some other notable slack plugins:

  • SlackRTM implementation (now implemented at slackrtm.py)

# ## ###

Clone this wiki locally