Synchronize messages between Slack and IRC.
gitnode.js&npm
$ git clone https://github.com/fntsrlike/slack-irc-syncbot.git
$ cd slack-irc-syncbot
$ npm installRefer config.js.sample to write your own configuration. Meaning of setting detail could refer the section "Configuration". After create your configuration to project root as config.js, execute the command:
$ node <設定檔名>It will execute program. To join IRC channel may need for a while. When finished setup progress, it will display messages as following:
$ node config.js
.............done!
Server running at http://localhost:8080/This project also support docker. If you have install docker and docker-compose, you can excute project without installing node.js in your local.
gitdockerdocker-compose
After you create your own configuration as config.js in project root, edit docker-compose.yml to setting arguments of docker, usually we will set volumes and ports. At last, execute command:
$ docker-compose up -ddocker will create image and container to execute program in background.
In thie section, we will explain how to set configuration with config.js.sample.
'use strict';
var App = require('./lib/app');
// -- Setting form this line
// Basic configuration of IRCBot
// var config = {
// nick: '<IRCBot's nick>',
// username: '<IRCBot's username>',
// password: '<IRCBot's password, option>',
// token: '<Slack API token>',
// incomeUrl: '<Slack Incoming Integrations Income Url',
// outgoingToken: ['<Slack Outgoing Integrations token>'],
// serverPort: 80
// };
var config = {
nick: 'slackbot',
username: 'slackbot-username',
token: 'XXXX-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-XXXXXX',
incomeUrl: 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX',
outgoingToken: ['XXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX'],
serverPort: 80
};
// The channels wanna be sync messages.
config.channels = {
'#<IRC channel> [password, option]': '#<Slack channgel>',
'#sample' : '#general'
};
// To sync nicks and avatar of user
config.users = {
'<IRC username(NOT NICK)>': '<Slack username>',
'ircuser': 'slackuser'
};
// Baned list of IRC Nicks. Usually are bots.
config.bannedIRCNicks = [
'<IRC Nick>',
'ircNick'
];
// To filter messages has bad word or dirty word
config.bannedKeywords = [
'keyword'
];
// -- Setting end on this line
App( config ).start();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 Integrations
server: IRC server, default isirc.freenode.comiconUrl: 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 80httpsServerPort: AsserverPortbut in https connection. default is 443.initializeTimeoutLimit: 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: Set true to sync nicks.isMapAvatar: Set true to sync avatarisHttpsConnecttion' Settrue` to turn on https connection.- `isDisplayInfo' Set true to let index display some public information.
Other config options about IRCBot, can refer node-irc