slack-irc-bot is a Slack to IRC bot written in JavaScript for Node.
The application passes messages between a Slack channel and an IRC channel in both directions.
Install from npm:
npm install slack-irc-bot
You can also clone this repository with git:
git clone https://github.com/kurkku/slack-irc-bot.git
and install dependencies using npm:
cd slack-irc-bot
npm install
slack-irc-bot can be used as a module, too:
var Bot = require('slack-irc-bot');
var config = require('./your_config.json');
Bot(config);
Note: node-irc depends on a character-set detection library icu. Your host must have libiconv and libicu installed in order to use this functionality -- otherwise you'll recieve errors when building these dependencies. However, node-irc will install and work fine -- without character-set functionality -- even though icu won't install correctly.
You must have a Slack bot token to be able to use Slack Real Time Messaging API. Create one at https://my.slack.com/services/new/bot for your team.
The bot is configured by editing config/config.json file. The configuration file must be passed to the application upon startup.
slack.token
: Your Slack bot tokenslack.channel
: Channel name that is replayed in IRC and where IRC messages are written toirc.server
: IRC server domain nameirc.nick
: Nickname of the IRC botirc.userName
: Username of the botirc.channel.name
: Name of the IRC channelirc.channel.protected
: Is the channel password-protected?irc.channel.password
: Password of the channel
slack.autoReconnect
: Should client reconnect upon disconnectslack.autoMark
: Should read messages be marked as readirc.port
: IRC server port. If undefined, 6667 is used.irc.realName
: Real name of the botirc.localAddress
: Local address of your host (optional)irc.debug
: If enabled debug messages are written to console.irc.encoding
: Encoding which IRC messages are converted to. Slack expects UTF-8.
Start the bot with node app.js -c your_config.json
If the bot was installed globally using npm install --global slack-irc-bot
you can start it with slack-irc-bot
as well.
Run tests with npm run test
and npm run coverage
A Docker container of slack-irc-bot is available here.