Synchronize messages between Slack and IRC.
git clone https://github.com/fntsrlike/slack-irc-syncbot.git
cd slack-irc-syncbot
npm install
Write your own configuration file (Refer config.sample.js
) is a good starting point for building your own. The details can refer Configure part in below.
Save this to a file in the root of the project then run your bot with:
node your-config
This will launch the bot in your terminal based on provided configuration.
This project also support docker. you can clone the project and configure it. BTW, your config file should be named config.js
.
$ git clone https://github.com/fntsrlike/slack-irc-syncbot.git
$ cd slack-irc-syncbot
$ cp config.sample.js config.js
$ vim config.js
...
Then build image and run.
$ docker build --tag="slack-irc-syncbot" ./
...
$ docker run -d -P slack-irc-syncbot
If you don't want to rebuild images after editing config file, just use volume to sync config and restart container.
$ docker run -d -P -v $PWD/config.js:/app/config.js --name="slackbot" slack-irc-syncbot
$ vim config.js
...
$ docker restart slackbot
In addition, if your want to specify expose port, remember to use -p
argument replace -P
Explain configuration in config.sample.js with comment.
var config = {
// Require item
nick: 'slackbot',
username: 'slackbot-username',
token: 'XXXX-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-XXXXXX',
incomeUrl: 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX',
outgoingToken: 'XXXXXXXXXXXXXXXXXXXXXXXX',
};
// Channels map
config.channels = {
'#irc-channel password(optional)': '#slack-channel'
};
// Users map
// Index is not nick, but username at IRC. It could be get by `/whois`.
// Value is slack's username.
config.users = {
'ircLogin (not nick)': 'slackUser'
};
nick
: IRCbot's nick, it should be unique on IRC Serverusername
: IRC bot's usernametoken
: Slack's API tokenincomeUrl
: From Incoming WebHooks of IntegrationsoutgoingToken
: From Outgoing WebHooks of Integrationschannels
: Channels map. Decide to sync which IRC chanel to Slack channelusers
: Users map. Let messages sync from IRC could dislpay usesname of Slack
server
: IRC server, default isirc.freenode.com
iconUrl
: Default ICON for messages from IRC to Slack by url. 48*48 size is bettericonEmoji
: As iconUrl but by emoji code. It will override by iconUrlserverPort
: The port of web application to get post request from slack. default is 80initializeTimeoutLimit
: Set seconds to be limit time of initialization.listUpdatedPeriod
: Set seconds to update user list
isSilent
: Set true to stop IRC bot from speaking into the channelisSystemSilent
: Set true to stop speak any bot's system messagesisUsersTracking
: Set true to tracking IRC users' nick. Otherwise, user mapping will be turn off.isAutoTildeAdded
: Set true to add tilde prefix on IRC nicksisShowSlackChannel
: Set true to display channel name of slack on IRC channelisMapName
:isMapAvatar
:
Other config options about IRCBot, can refer node-irc