Adding a Slack network to your znc IRC bouncer

2 minute read

Slack is taking the online world by storm. Most everyone I know in technology is a member of at least one Slack teams, and it’s not rare to find people who are a member of ten or more Slacks.

My personal opinion of Slack is indifference. It’s pretty much just IRC with a fancy new paint job. I love IRC, so that element of the Slack service appeals to me greatly. However…that paint job…no. There’s just too much going on there. Too many gifs. Too many emoji. It’s very distracting.

Add to that distraction the burden of having yet another damn chat client on my desktop. IRC, Hangouts, Skype, iMessage, Twitter… It’s just too much.

Thankfully, Slack offers an IRC gateway, allowing you to escape that loud and distracting paint job while you also reduce the number of chat clients you need open. You can either connect to Slack directly using your IRC client of choice or–if you want scrollback from when you’re offline–you can set it up on your IRC bouncer. The latter is the option I pursued. As it was rather a pain in the ass, I’ve captured the steps below so you don’t have to suffer the same headaches I did.

CAVEAT: I use znc as my bouncer (installed on a Digital Ocean droplet), the webadmin interface to znc for all admin tasks, and Textual on OS X for my IRC client. All information below is presented in the context of this software.

Setup on the znc side

  1. If they haven’t done so yet, please ask your Slack administrator/team owner to enable the IRC gateway.
  2. Once that’s done, access your account gateway page. It’s available at http://$TEAMNAME.slack.com/account/gateways. You’ll need this information for the next steps.
  3. Log into the znc web admin interface, edit the user which will be connecting to Slack, then click “Add” in the Network box. The full click path for this is Manage Users > Edit (next to selected user) > Add (in Network box).
  4. Most fields on the Add Network form are what you’d expect, but there are a couple of potential snags…
    • The network name must be alphanumeric and cannot contain any spaces. If you receive the following error, check the network name for invalid characters: "Invalid network name. It should be alphanumeric. Not to be confused with server name
    • The server address should be entered in the following format:
      $TEAMNAME.irc.slack.com +6667 $PASSWORD_FROM_GATEWAY_PAGE
      The + is important because it denotes that SSL should be used. Slack doesn’t allow unencrypted connections.
  5. That should be it. Save the form, then move on to setting up your IRC client.

Setup on the Textual (v5.0) side

  1. Open the interface for adding a new server: Server > Add Server
    • Name the connection whatever makes most sense for you.
    • Enter the address of your znc bouncer in the Server Address field.
    • Check the “Connect Securely” box since, again, Slack doesn’t allow unencrypted connections.
    • Enter your znc user password in the “Server Password” field.
    • Select the “Identity” option (in the left side-bar in Textual v5.0).
    • Enter your Slack nickname in the “Nickname” field.
    • For “Username”, enter your znc username, a slash, then the Network Name you selected when adding the new network in znc: $USERNAME/$NETWORK_NAME
    • For “Personal Password,” enter the password from the Slack account gateway page.
    • Save the new server to the client.</ol> Theoretically, you can now connect. The client will automatically find all of the channels to which you were already subscribed on Slack. You may need to tweak a few more options to make it suit your tastes, but the hard part is now done.