mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Add topic event support for IRC node
This commit is contained in:
parent
b6bbcbd52f
commit
304c379b0d
@ -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>
|
||||
|
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user