diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 9cac44f..cbddcd3 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Parse NOTICE and added hook on_notice. * Added hooks on_uprivmsg and on_cprivmsg. * Module names are now case sensitive. * Added config option module for auto-loading a module. diff --git a/src/Parser/IRC.pm b/src/Parser/IRC.pm index 3393f08..49dc92c 100644 --- a/src/Parser/IRC.pm +++ b/src/Parser/IRC.pm @@ -25,6 +25,7 @@ our %RAWC = ( '477' => \&num477, 'JOIN' => \&cjoin, 'NICK' => \&nick, + 'NOTICE' => \¬ice, 'PRIVMSG' => \&privmsg, 'TOPIC' => \&topic, ); @@ -36,6 +37,7 @@ our (%got_001, %botnick, %botchans, %csprefix, %chanusers); API::Std::event_add("on_rcjoin"); API::Std::event_add("on_ucjoin"); API::Std::event_add("on_nick"); +API::Std::event_add("on_notice"); API::Std::event_add("on_cprivmsg"); API::Std::event_add("on_uprivmsg"); API::Std::event_add("on_topic"); @@ -338,6 +340,16 @@ sub nick return 1; } +# Parse: NOTICE +sub notice +{ + my ($svr, @ex) = @_; + + API::Std::event_run("on_notice", ($svr, @ex)); + + return 1; +} + # Parse: PRIVMSG sub privmsg {