Merge pull request #144 from endreszabo/master

Add topic event support for IRC node
This commit is contained in:
Dave Conway-Jones 2015-11-21 17:29:03 +00:00
commit 59881386e8
2 changed files with 9 additions and 0 deletions

View File

@ -75,6 +75,10 @@
<td>kick</td>
<td>a user is kicked from a channel</td>
</tr>
<tr>
<td>topic</td>
<td>a topic has been changed on a joined channel</td>
</tr>
<tr>
<td>names</td>
<td>retrieves the list of users when the bot joins a channel</td>

View File

@ -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]);