-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
35 lines (30 loc) · 985 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*jslint node: true nomen: true stupid: true */
'use strict';
var IRCBot = require('./bot.js');
var Settings = require('./settings.js');
/* Bot inicialization */
var options = {
//bot related
loadPlugins: Settings.loadPlugins || true,
pluginsSettings: Settings.pluginsSettings,
// IRC library related
debug: Settings.debug || false,
floodProtection: true, //make it default in the bot
userName: Settings.userName || 'BotonJS',
realName: Settings.realName || 'BotonJS',
channels: Settings.channels
};
var bot = new IRCBot.IRCBot(Settings.server, Settings.nickName, options);
bot.on('error', function error(message) {
console.log(message);
});
/* Process SIGNAL handlers */
process.on('SIGINT', function exit() {
function quit() {
process.exit(0);
}
// Schedule the quit after the disconnect
// seems to be a workaround some IRC bug...
process.nextTick(quit);
bot._client.disconnect('Un deploy me llama');
});