Skip to content

Instantly share code, notes, and snippets.

@Igglybuff
Last active October 3, 2022 21:16
Show Gist options
  • Save Igglybuff/00d5e91274a562ac724d358bbbc8bc7b to your computer and use it in GitHub Desktop.
Save Igglybuff/00d5e91274a562ac724d358bbbc8bc7b to your computer and use it in GitHub Desktop.
Slack notifications for autodl-irssi

autodl-irssi Slack notifications

Dependencies

  • A Slack workspace
  • autodl-irssi set up in ruTorrent
  • Docker (sort of optional)

Instructions

  1. Create a Slack channel in your workspace, e.g. #autodl-irssi

  2. Pick an IRC server to create a channel in. I will use yolo.hackint.org (on port 6697 with SSL enabled) in this example.

  3. Create an IRC channel with /join #username-autodl from a connected IRC client. The channel name should be unique and specific to you somehow (e.g. #igglybuff-autodl).

  4. Create a Slack bot user and add it to your workspace.

  5. Get your bot user OAuth access token.

    i. Head to https://api.slack.com/apps

    ii. Click on your app

    iii. Under "Features", click "Oauth & Permissions"

    iv. Copy the text under "Bot User OAuth Access Token"

  6. Create a file called config.json somewhere on your server that looks like this:

[
  {
    "nickname": "uniqueautodlbotname",
    "server": "yolo.hackint.org",
    "token": "<bot oauth2 token>",
    "channelMapping": {
      "#my-slack-channel": "#my-irc-channel"
    },
    "ircOptions": {
      "floodProtection": false,
      "floodProtectionDelay": 1000,
      "debug": true,
      "port": 6697,
      "secure": true,
      "selfSigned": true,
      "nick": "uniqueautodlbotname"
     }
  }
]
  1. Change the channels + nickname and add your OAuth2 token to match what you set up earlier.
  2. Run docker run -d --name=slack-irc --restart=always -v /path/to/config-dir:/config benramsey/slack-irc:latest replacing /path/to/config-dir with the path to the directory storing your config.json file on your server. (benramsey/slack-irc is based on Martin Ek's slack-irc bridge)
  3. Watch the logs with docker logs -f slack-irc in case there are any errors due to misconfiguration.
  4. Test bidirectional communication by sending test messages in both the IRC channel and the Slack channel.
  5. Go to ruTorrent and in your autodl-irssi "IRC Servers..." menu add the IRC server then click OK.
  6. In your autodl-irssi "Preferences..." menu, click the "IRC" tab and tick the box next to "Auto connect to IRC servers and channels" and enter the IRC server name next to "Server" and the channel next to "Channel" then click OK.
  7. In the "autodl-irssi" tab in ruTorrent, click "Version" to test the configuration.

autodl-irssi should join the IRC channel with the nick you configured in ruTorrent and any messages should be send to both Slack and IRC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment