Fixed an issue in HELP.
This commit is contained in:
1 parent
2ca0885741
commit
72006a8e7e
2 files changed
+31
-25
No files matched your search
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
* Fixed an issue in HELP.
|
||||||
* Added a Ping module.
|
* Added a Ping module.
|
||||||
* Moved Werewolf back to stable.
|
* Moved Werewolf back to stable.
|
||||||
|
|
||||||
|
|||||||
+30
-25
@@ -265,41 +265,46 @@ sub cmd_help
|
|||||||
# Help for a specific command was requested. Lets get it.
|
# Help for a specific command was requested. Lets get it.
|
||||||
my $rcm = uc($argv[0]);
|
my $rcm = uc($argv[0]);
|
||||||
|
|
||||||
if (exists $API::Std::CMDS{$rcm}{help}) {
|
# If there is help for this command.
|
||||||
# If there is help for this command.
|
if (exists $API::Std::CMDS{$rcm}) {
|
||||||
|
if (exists $API::Std::CMDS{$rcm}{help}) {
|
||||||
# Check for necessary privileges.
|
# Check for necessary privileges.
|
||||||
if ($API::Std::CMDS{$rcm}{priv}) {
|
if ($API::Std::CMDS{$rcm}{priv}) {
|
||||||
if (!has_priv(match_user(%$src), $API::Std::CMDS{$rcm}{priv})) {
|
if (!has_priv(match_user(%$src), $API::Std::CMDS{$rcm}{priv})) {
|
||||||
notice($src->{svr}, $src->{nick}, trans("Access denied").".");
|
notice($src->{svr}, $src->{nick}, trans("Access denied").".");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($API::Std::CMDS{$rcm}{help}) {
|
if ($API::Std::CMDS{$rcm}{help}) {
|
||||||
# If there is valid help for this command.
|
# If there is valid help for this command.
|
||||||
|
|
||||||
# Get the language.
|
# Get the language.
|
||||||
my ($lang, undef) = split('_', $Auto::LOCALE);
|
my ($lang, undef) = split('_', $Auto::LOCALE);
|
||||||
|
|
||||||
if (exists ${ $API::Std::CMDS{$rcm}{help} }{$lang}) {
|
if (exists ${ $API::Std::CMDS{$rcm}{help} }{$lang}) {
|
||||||
# If help for this command is available in the configured language.
|
# If help for this command is available in the configured language.
|
||||||
notice($src->{svr}, $src->{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{$lang});
|
notice($src->{svr}, $src->{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{$lang});
|
||||||
}
|
|
||||||
else {
|
|
||||||
# If it isn't, default to English.
|
|
||||||
if (exists ${ $API::Std::CMDS{$rcm}{help} }{en}) {
|
|
||||||
# If help for this command is available in English.
|
|
||||||
notice($src->{svr}, $src->{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{en});
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# If it isn't, no help.
|
# If it isn't, default to English.
|
||||||
notice($src->{svr}, $src->{nick}, "No help for \002".$rcm."\002 available.");
|
if (exists ${ $API::Std::CMDS{$rcm}{help} }{en}) {
|
||||||
|
# If help for this command is available in English.
|
||||||
|
notice($src->{svr}, $src->{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{en});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# If it isn't, no help.
|
||||||
|
notice($src->{svr}, $src->{nick}, "No help for \002".$rcm."\002 available.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
# If it isn't valid, no help.
|
||||||
|
notice($src->{svr}, $src->{nick}, "No help for \002".$rcm."\002 available.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# If it isn't valid, no help.
|
# If there is no help, don't give any.
|
||||||
notice($src->{svr}, $src->{nick}, "No help for \002".$rcm."\002 available.");
|
notice($src->{svr}, $src->{nick}, "No help for \002".$rcm."\002 available.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user