From 304c379b0d9425b4e101761562b90852116c5aae Mon Sep 17 00:00:00 2001 From: "git@end.re" Date: Mon, 16 Nov 2015 09:33:59 +0100 Subject: [PATCH] Add topic event support for IRC node --- social/irc/91-irc.html | 4 ++++ social/irc/91-irc.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/social/irc/91-irc.html b/social/irc/91-irc.html index 9586e296..ecae4b86 100644 --- a/social/irc/91-irc.html +++ b/social/irc/91-irc.html @@ -75,6 +75,10 @@ kick a user is kicked from a channel + + topic + a topic has been changed on a joined channel + names retrieves the list of users when the bot joins a channel diff --git a/social/irc/91-irc.js b/social/irc/91-irc.js index 48a2287c..6261e14c 100644 --- a/social/irc/91-irc.js +++ b/social/irc/91-irc.js @@ -166,6 +166,11 @@ module.exports = function(RED) { node.send([null,msg]); //node.log(who+' '+RED._("irc.errors.hasleft")+' '+channel+': '+reason); }); + node.ircclient.addListener('topic', function (channel, topic, nick, message) { + var msg = { "payload": { "type":"topic", "who":nick, "channel":channel, "topic":topic, "message":message } }; + node.send([null,msg]); + //node.log(nick+' '+RED._("irc.errors.topicchanged")+' '+channel+': '+topic); + }); node.ircclient.addListener('quit', function(nick, reason, channels, message) { var msg = { "payload": { "type":"quit", "who":nick, "channel":channels, "reason":reason } }; node.send([null,msg]);