Added hooks on_uprivmsg and on_cprivmsg.
This commit is contained in:
1 parent
ca54a07f9a
commit
344500bcd7
2 files changed
+10
No files matched your search
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
==================================================================
|
==================================================================
|
||||||
|
* Added hooks on_uprivmsg and on_cprivmsg.
|
||||||
* Module names are now case sensitive.
|
* Module names are now case sensitive.
|
||||||
* Added config option module for auto-loading a module.
|
* Added config option module for auto-loading a module.
|
||||||
* Fixed a bug in API::Log that caused invalid months.
|
* Fixed a bug in API::Log that caused invalid months.
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ our %RAWC = (
|
|||||||
'JOIN' => \&cjoin,
|
'JOIN' => \&cjoin,
|
||||||
'NICK' => \&nick,
|
'NICK' => \&nick,
|
||||||
'PRIVMSG' => \&privmsg,
|
'PRIVMSG' => \&privmsg,
|
||||||
|
'TOPIC' => \&topic,
|
||||||
);
|
);
|
||||||
|
|
||||||
# Variables for various functions.
|
# 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_rcjoin");
|
||||||
API::Std::event_add("on_ucjoin");
|
API::Std::event_add("on_ucjoin");
|
||||||
API::Std::event_add("on_nick");
|
API::Std::event_add("on_nick");
|
||||||
|
API::Std::event_add("on_cprivmsg");
|
||||||
|
API::Std::event_add("on_uprivmsg");
|
||||||
API::Std::event_add("on_topic");
|
API::Std::event_add("on_topic");
|
||||||
|
|
||||||
# Parse raw data.
|
# Parse raw data.
|
||||||
@@ -358,6 +361,9 @@ sub privmsg
|
|||||||
&{ $API::Std::CMDS{$cmd}{sub} }(%data) if $rprefix eq $cprefix;
|
&{ $API::Std::CMDS{$cmd}{sub} }(%data) if $rprefix eq $cprefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Trigger event on_uprivmsg.
|
||||||
|
API::Std::event_run("on_uprivmsg", ($svr, @ex));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# It is coming to us in a channel message.
|
# 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;
|
&{ $API::Std::CMDS{$cmd}{sub} }(%data) if $rprefix eq $cprefix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Trigger event on_cprivmsg.
|
||||||
|
API::Std::event_run("on_cprivmsg", ($svr, @ex));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in new issue
Block a user