We now pass nicer arguments to command callbacks.

This commit is contained in:
Elijah Perrault committed 2011-02-15 21:35:32 -07:00
1 parent 853c7e087e
commit c2b436f420
2 files changed
+5 -5

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
===============================================================================
* Changed command callback arguments to: \%src, @args
* Bundle server with \%src in the on_rcjoin event.
* logchan is now joined automatically.
* Changed on_notice arguments to: \%src, $target, @msg
+4 -5
View File
@@ -534,7 +534,6 @@ sub privmsg
push(@argv, $ex[$i]);
}
$data{svr} = $svr;
@{ $data{args} } = @argv;
my ($cmd, $cprefix, $rprefix);
# Check if it's to a channel or to us.
@@ -554,7 +553,7 @@ sub privmsg
# If this command requires a privilege...
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
# Make sure they have it.
&{ $API::Std::CMDS{$cmd}{'sub'} }(%data);
&{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv);
}
else {
# Else give them the boot.
@@ -563,7 +562,7 @@ sub privmsg
}
else {
# Else execute the command without any extra checks.
&{ $API::Std::CMDS{$cmd}{'sub'} }(%data);
&{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv);
}
}
else {
@@ -595,7 +594,7 @@ sub privmsg
# If this command takes a privilege...
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
# Make sure they have it.
&{ $API::Std::CMDS{$cmd}{'sub'} }(%data) if $rprefix eq $cprefix;
&{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv) if $rprefix eq $cprefix;
}
else {
# Else give them the boot.
@@ -604,7 +603,7 @@ sub privmsg
}
else {
# Else continue executing without any extra checks.
&{ $API::Std::CMDS{$cmd}{'sub'} }(%data) if $rprefix eq $cprefix;
&{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv) if $rprefix eq $cprefix;
}
}
else {