Using Slack With IRC Clients After May, 2018

Slack seems to be getting more aggressive about insisting you use a bloated GUI. When it began, it was easy to use with irssi and weechat. Now, as you'll see below, both require 3rd party programs to work. Both require either legacy tokens (pretty easy to get) or OathTokens (requiring more work).

Slack now says it will be removing legacy tokens in May. Whether the methods outlined below will work after that, I don't know Legacy tokens that I had gotten much earlier still work as of August, 2023.

Unfortunately, (to my point of view, anyway) people have gotten so used to bloated GUIs that they can get away with this. Slack seems to have successfully pulled off the thing that used to be attributed to Microsoft, embrace, engulf, extinguish. One can only hope that more IT departments will go back to using IRC, but it seems doubtful.

When Slack, the chat client, first came along, it provided gateways for using one's desired irc client. As of May 15, 2018, they dropped this. Whether one uses Slack out of choice or necessity, many of us wanted to continue using our irc client, at least in most circumstances. This article covers using weechat and irssi with Slack.

There is a slack-term. I tried it briefly, it worked with legacy tokens, Its github page is here. There is a link there that takes you to another page explaining how to get a slack token. It seems as if it may be a good solution for those of us who prefer terminal clients. If I were stuck, this would be what I'd try.

There is also the localslackirc gateway. I haven't gotten that one working for me, so can't really judge it.

The weechat-slack plugin is easy to use. All instructions are right there on the github page, and step by step instructions are right under the setup section. Upon saving your configuration, as pointed out in the article, once you reopen, you will have your slack channels all open, as if you'd logged out and back into the web interface. I have not put instructions here because they are so clearly outlined on the github page. The only issue is getting the token.

With upgrades to weechat, if you are using the original plugin, it may stop working. If you've upgraded weechat and the slack plugin no longer works, go back to the github page and get the latest wee_slack.py. The original one should be in $HOME/.weechat/python, possibly with a symlink in $HOME/.weechat/python/autoload.

As a sidenote, when talking about upgrading, those who use FreeBSD and use weechat with aspell for spell check, will find that aspell no longer works. The description didn't make it into the last commit, but this is easily fixed by using spell, instead of aspell. So, next time you start weechat
/spell enable
/set spell.check.default_dict en

That, of course, assumes you're using English, If not, replace the en with your language, e.g,, de or fr

One last note on weechat. If the mouse is enabled, it won't cut or paste text in a weechat buffer. However, if you hit the shift key, you will be able to cut and paste text. In my weechat use, the only time I use the mouse is to cut or paste text, so I have mouse = off in my ~/.weechat/weechat.conf. This allows cutting and pasting in buffer without having to use the shift key. I mention this because, although it is in their FAQ, I overlooked it and it took me quite awhile to figure out why I couldn't cut and paste text into a buffer. To do it while weechat is running, type /mouse disable which will disable the mouse and write it to your weechat.conf file.

Using irssi requires a bit more work. It used to work with bitlbee but hasn't in awhile. There is an irc-slack project on github. This works, but takes some effort, and I found the instructions a bit unclear. So first, clone it, which should only take a few moments.
git clone https://github.com/insomniacslk/irc-slack.git
cd irc-slack/cmd/irc-slack
make

You need to have golang (on Rocky and Mint) or go (on FreeBSD) for this to work. This creates a binary, irc-slack and can now be run with
./irc-slack

Now you need to get a token. The project's author gives links to a couple of pages for instructions. I was able to get the token and cookie using the information at the localslackirc project's page. After running the two sections of javascript code mentioned, I had a token and a cookie. The part you need for the cookie is the part beginning with d=. You have to look for it, there's an a=, x=, etc. It might be the string just before d- and, importantly, it ends with a semicolon(;). You need that semicolon at the end.

Now going back to the irc-slack page, we create a slack pass concatenating the cookie and the token with a pipe in between. So it will be something like
xoxc-1234xxx|d=1234xxx;

(Both token and cookie are far longer strings).

Now assuming you've already started the irc-slack command as described above, open irssi and connect to your slack team. In irssi, if your team's name is myteam.slack.com
/network add myteam.slack.com
/server add -auto -network myteam.slack.com localhost 6666 
/connect localhost

The slack pass is the concatenated file of token and cookie. Only use the auto option if you want to connect every time you start irssi. The irc-slack github page says to use /connect myteam.slack.com but that didn't work for me, when I did /server list I saw that the slack server was listed as localhost. If it doesn't work, check your $HOME/.irssi/config file. The first couple of times I tried it, I messed up pasting in the password and my config file would read something like myteam.slack.com and no password, then a second server named xoxc-xxx123, i.e., the entire password string. Also make sure that final semicolon is included in the password's string. As each line ends with a semicolon, it can be a little confusing, but it should look something like
 address = "localhost";
 chatnet = "myteam.slack.com";
 port = "6666";
 password = "xoxc-xxx1234|d=xxx1234%22%SA;";

(There will be some % signs in your cookie.) Make sure that the cookie ends with a semicolon INSIDE the quotes, followed by the semicolon outside the quotes to close the line.

If you need to view your token in weechat, say, for example, you've been using weeslack and want to try irc-slack with irssi, you can display it with fset. If you're already connected to slack with weechat, run
/fset plugins.var.python.slack.slack_api_token

and an fset buffer will open showing the token being used.

You can view your token used in irssi by looking through $HOME/.irssi/config to do the reverse, use your irssi token with weeslack.

Hopefully, Slack will leave these methods for weechat and irssi working. But one never knows, when they started, they were lauding their compatibility with irc.