We now pass nicer arguments to command callbacks.
This commit is contained in:
1 parent
853c7e087e
commit
c2b436f420
2 files changed
+5
-5
No files matched your search
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
* Changed command callback arguments to: \%src, @args
|
||||||
* Bundle server with \%src in the on_rcjoin event.
|
* Bundle server with \%src in the on_rcjoin event.
|
||||||
* logchan is now joined automatically.
|
* logchan is now joined automatically.
|
||||||
* Changed on_notice arguments to: \%src, $target, @msg
|
* Changed on_notice arguments to: \%src, $target, @msg
|
||||||
|
|||||||
+4
-5
@@ -534,7 +534,6 @@ sub privmsg
|
|||||||
push(@argv, $ex[$i]);
|
push(@argv, $ex[$i]);
|
||||||
}
|
}
|
||||||
$data{svr} = $svr;
|
$data{svr} = $svr;
|
||||||
@{ $data{args} } = @argv;
|
|
||||||
|
|
||||||
my ($cmd, $cprefix, $rprefix);
|
my ($cmd, $cprefix, $rprefix);
|
||||||
# Check if it's to a channel or to us.
|
# Check if it's to a channel or to us.
|
||||||
@@ -554,7 +553,7 @@ sub privmsg
|
|||||||
# If this command requires a privilege...
|
# If this command requires a privilege...
|
||||||
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
|
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
|
||||||
# Make sure they have it.
|
# Make sure they have it.
|
||||||
&{ $API::Std::CMDS{$cmd}{'sub'} }(%data);
|
&{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Else give them the boot.
|
# Else give them the boot.
|
||||||
@@ -563,7 +562,7 @@ sub privmsg
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Else execute the command without any extra checks.
|
# Else execute the command without any extra checks.
|
||||||
&{ $API::Std::CMDS{$cmd}{'sub'} }(%data);
|
&{ $API::Std::CMDS{$cmd}{'sub'} }(\%data, @argv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -595,7 +594,7 @@ sub privmsg
|
|||||||
# If this command takes a privilege...
|
# If this command takes a privilege...
|
||||||
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
|
if (API::Std::has_priv(API::Std::match_user(%data), $API::Std::CMDS{$cmd}{priv})) {
|
||||||
# Make sure they have it.
|
# 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 {
|
||||||
# Else give them the boot.
|
# Else give them the boot.
|
||||||
@@ -604,7 +603,7 @@ sub privmsg
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Else continue executing without any extra checks.
|
# 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 {
|
else {
|
||||||
|
|||||||
Reference in new issue
Block a user