From 51490cc93e2211becc6dc6b247d0ff86240b4777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=A4rtner?= Date: Sat, 22 Feb 2014 17:09:15 +0100 Subject: [PATCH] Added NOTICE listener --- src/irc.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/irc.coffee b/src/irc.coffee index df1c7c5..6ddee37 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -197,6 +197,17 @@ class IrcBot extends Adapter for nick of nicks self.createUser channel, nick + bot.addListener 'notice', (from, to, message) -> + if from in options.ignoreUsers + console.log('Ignoring user: %s', from) + # we'll ignore this message if it's from someone we want to ignore + return + + console.log "NOTICE from #{from} to #{to}: #{message}" + + user = self.createUser to, from + self.receive new TextMessage(user, message) + bot.addListener 'message', (from, to, message) -> if options.nick.toLowerCase() == to.toLowerCase() # this is a private message, let the 'pm' listener handle it