Added hooks on_uprivmsg and on_cprivmsg.

This commit is contained in:
Elijah Perrault committed 2011-01-29 17:14:47 -07:00
1 parent ca54a07f9a
commit 344500bcd7
2 files changed
+10

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
==================================================================
* Added hooks on_uprivmsg and on_cprivmsg.
* Module names are now case sensitive.
* Added config option module for auto-loading a module.
* Fixed a bug in API::Log that caused invalid months.
+9
View File
@@ -26,6 +26,7 @@ our %RAWC = (
'JOIN' => \&cjoin,
'NICK' => \&nick,
'PRIVMSG' => \&privmsg,
'TOPIC' => \&topic,
);
# Variables for various functions.
@@ -35,6 +36,8 @@ 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_cprivmsg");
API::Std::event_add("on_uprivmsg");
API::Std::event_add("on_topic");
# Parse raw data.
@@ -358,6 +361,9 @@ sub privmsg
&{ $API::Std::CMDS{$cmd}{sub} }(%data) if $rprefix eq $cprefix;
}
}
# Trigger event on_uprivmsg.
API::Std::event_run("on_uprivmsg", ($svr, @ex));
}
else {
# It is coming to us in a channel message.
@@ -370,6 +376,9 @@ sub privmsg
&{ $API::Std::CMDS{$cmd}{sub} }(%data) if $rprefix eq $cprefix;
}
}
# Trigger event on_cprivmsg.
API::Std::event_run("on_cprivmsg", ($svr, @ex));
}
return 1;