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.

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, and also the localslackirc on codeberg.org. The irc-slack project worked for me for awhile but doesn't as of June 2024. It connects and shows all the channels, but then immediately loses connection and won't reconnect.

I'm leaving in this part about getting a token, because if I ever do get working again, I'll need it, but as mentioned, hasn't worked for me lately. Anyway, to get the 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. The instructions are fairly simple. Connect to your slack team using firefox. Then go to the firefox menu (in FreeBSD, it's the three lines at upper right), choose more tools, then web developer tools. Go to the network tab, then click WS. Select the connection, if it doesn't show one, refresh the page. Right click, choose Copy, and then copy with cURL. Save the result. You should see both the token, terminated by an &, and a Cookie, with things like b=, d= and so on. You want the d= line. Be sure to include the semicolon at the end of the line. You need that semicolon at the end.

Now, if using irc-slack, you have to concatenate the token and the d=cookie, so that it looks like xoxc-1111|d=xoxo-1111. Of course, the keys are far longer.

In my case, I used git to clone it, and once built, it had an irc-slack/cmd/irc-slack/irc-slack binary. I would just run that by cd-ing to the directory and running .irc-slack.

Then, starting irssi, you can run, assuming your slack team is myteam.slack.com
/network add myteam.slack.com
/server add -auto -network myteam.slack.com localhost 6666 xoxo-1111|d=xoxo111
/connect myteam.slack.com

This worked for me for awhile, but as menntioned, started immediately losing connection. So, I went to try localslackirc

The author of localslackirc recommends using Debian testing and provides a .deb file. According to the man page (comes with the .deb package) the default location for the token is ~/.localslackirc. The documentation isn't too clear, at least to me. Does one create a token file, inside such a directory? When trying to use the binary, I just made a file, ~/.localslackirc that consisted of the token, and then a second file for the cookie which I called cookie. Then I ran it with
localslackirc -c cookie

It started without an error, but irssi didn't successfully connect.

The author suggests using systemd. I installed a Debian vm, and upgraded it to testing, as the author suggests. I then installed the .deb package, which creates, among other things, an /etc/localslackirc.d directory with an example config in it. I copied the example file to config, and made my changes there. Mostly, you can leave the defaults, but there's a line for the token and another for the cookie. As the project's page says, it will look something like
TOKEN=xoxc-1111111
COOKIE=d=xoxd-1111

but with far longer strings.

Assuming you've called your config file config, you can now start it with systemd.
sudo systemctl start localslackirc@config.service

Now start irssi and add the network and localhost as the server. Again, going by project's current codeberg page if the slack team is myteam.slack.com
/network add -user &llt;your_username> -realname "<realname>" -nick <your_nick> myteam.slack.com
/server add -auto -port 9007 -network myteam.slack.com localhost 
/connect localhost

As I said, neither of the two irssi programs works for me now, if I troubleshoot and fix it, I'll update the page, but weeslack works with little effort.

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.