modubot / modubot.js

Modubot: the scalable and extensible IRC bot.
https://modubot.net
BSD 3-Clause "New" or "Revised" License
19 stars 3 forks source link

Better Setup for Modubot (ZNC Support?) #47

Closed ZacharyDuBois closed 10 years ago

ZacharyDuBois commented 10 years ago

Modesto's setup is very vague and not easy. Make it something more understandable like, the config should look like an IRC client's config. Like server, port, SSL, server password, username, nick, and real name. I cannot get Modubot to connect to any network. I want Modubot to connect through my ZNC so I can have better control of it and filter what goes into it with my ZNC modules.

When I run npm start I get:

$ npm start

> modubot@0.2.4 start /home/nodejs/freenode/TokyoBot
> node ./bin/Modubot

{"name":"debugLog","hostname":"Hime","pid":12482,"level":30,"msg":"Connecting to chat.freenode.net:6667","time":"2014-07-25T04:29:44.296Z","v":0}
{"name":"debugLog","hostname":"Hime","pid":12482,"level":30,"msg":"Loading Plugin: kamaln7/ping","time":"2014-07-25T04:29:44.302Z","v":0}
{"name":"debugLog","hostname":"Hime","pid":12482,"level":30,"msg":"Connected to MongoDB","time":"2014-07-25T04:29:44.325Z","v":0}
{"name":"debugLog","hostname":"Hime","pid":12482,"level":40,"prefix":"sendak.freenode.net","server":"sendak.freenode.net","command":"err_needmoreparams","rawCommand":"461","commandType":"error","args":["*","PASS","Not enough parameters"],"msg":"","time":"2014-07-25T04:29:52.875Z","v":0}
\
/home/nodejs/freenode/TokyoBot/node_modules/irc/lib/irc.js:672
                    throw err;
                          ^
TypeError: Cannot call method 'split' of null
    at /home/nodejs/freenode/TokyoBot/node_modules/irc/lib/irc.js:568:59
    at Array.forEach (native)
    at Client.<anonymous> (/home/nodejs/freenode/TokyoBot/node_modules/irc/lib/irc.js:567:27)
    at Client.emit (events.js:95:17)
    at Client.<anonymous> (/home/nodejs/freenode/TokyoBot/node_modules/irc/lib/irc.js:298:22)
    at Client.emit (events.js:95:17)
    at /home/nodejs/freenode/TokyoBot/node_modules/irc/lib/irc.js:669:22
    at Array.forEach (native)
    at Socket.<anonymous> (/home/nodejs/freenode/TokyoBot/node_modules/irc/lib/irc.js:666:15)
    at Socket.emit (events.js:95:17)
|
npm ERR! modubot@0.2.4 start: `node ./bin/Modubot`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the modubot@0.2.4 start script.
npm ERR! This is most likely a problem with the modubot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/Modubot
npm ERR! You can get their info via:
npm ERR!     npm owner ls modubot
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /home/nodejs/freenode/TokyoBot
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/nodejs/freenode/TokyoBot/npm-debug.log
npm ERR! not ok code 0

So do you have any setup instructions for this?

kamaln7 commented 10 years ago

I don't think node-irc supports connecting to ZNC but either way you should just have modubot connect directly to the IRC server. See https://modubot.net/docs.html#getting-started-configuration for details on the config file.

If just setting the port to an SSL port doesn't work, try applying the following patch and setting network.secure in the config to true. Let me know if that works and I'll push it to the repo.

--- Bot.ts.original 2014-07-25 12:35:23.825438416 +0300
+++ Bot.ts  2014-07-25 12:35:48.977438899 +0300
@@ -106,7 +106,8 @@
            realName: config.network.realname,
            channels: config.network.channels,
            sasl: config.network.sasl,
-           password: config.network.password
+           password: config.network.password,
+           secure: config.network.secure || false
        });

        var plugins = this.config.plugins;
cd /path/to/modubot/src/Modubot
patch < Bot.ts.patch # Copy the diff above to Bot.ts.patch first
cd /path/to/modubot
grunt
vi config/config.yml # Add secure: true under `network`
npm start
ZacharyDuBois commented 10 years ago

Fixed in the new commits :) (Not the ZNC part)