freifunk-bot

Modular parser for the hackerspace door status with handlers for multiple services
git clone git://archive.git.mtrnord.blog/MTRNord/freifunk-bot.git
Log | Files | Refs | README | LICENSE

commit 217f29f06e86dbdfc3c23aa1eab3eaa507a13295
parent 46f63a02ede66f491b3659a729124afd59b0ce11
Author: MTRNord <mtrnord1@gmail.com>
Date:   Thu, 17 Mar 2016 19:48:41 +0100

Some bugfixes

Diffstat:
M.gitignore | 6++++--
Mhandlers/irc.js | 9+++++++--
2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -26,4 +26,6 @@ build/Release # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git node_modules install.js -uninstall.js -\ No newline at end of file +uninstall.js +daemon +serviceRestart.bat +\ No newline at end of file diff --git a/handlers/irc.js b/handlers/irc.js @@ -96,6 +96,11 @@ function join(event, callback) { client.join(event, callback); }); } +function list(event, callback) { + clients.forEach(function(client) { + client.list(event, callback); + }); +} function disconnect(event, callback) { clients.forEach(function(client) { client.disconnect(event, callback); @@ -344,12 +349,12 @@ module.exports = { door_status = "open"; } console.log(message); - bot.list(); + list(); console.log(channel[(channel.length-(channel.length-1))+1]); console.log(channel.length); if (channel[1] !== "this") { if (channel[1] !== " ") { - bot.addListener('channellist', function (channel_list) { + addListener('channellist', function (channel_list) { for (var key in channel_list) { if (channel_list.hasOwnProperty(key)) { if (channel_list[key]["name"] == channel[1]) {