Update Core::IRC and CHANGELOG.
This commit is contained in:
1 parent
69a64286ce
commit
26164f6006
3 files changed
+27
-42
No files matched your search
@@ -293,12 +293,12 @@ undef $it;
|
||||
# Create core hooks.
|
||||
API::Std::hook_add("on_uprivmsg", "ctcp_version_reply", \&Core::IRC::version_reply);
|
||||
# Create core commands.
|
||||
API::Std::cmd_add("MODLOAD", 1, \%Core::IRC::SHELP_MODLOAD, \%Core::IRC::FHELP_MODLOAD, \&Core::IRC::cmd_modload);
|
||||
API::Std::cmd_add("MODUNLOAD", 1, \%Core::IRC::SHELP_MODUNLOAD, \%Core::IRC::FHELP_MODUNLOAD, \&Core::IRC::cmd_modunload);
|
||||
API::Std::cmd_add("MODRELOAD", 1, \%Core::IRC::SHELP_MODRELOAD, \%Core::IRC::FHELP_MODRELOAD, \&Core::IRC::cmd_modreload);
|
||||
API::Std::cmd_add("SHUTDOWN", 2, \%Core::IRC::SHELP_SHUTDOWN, \%Core::IRC::FHELP_SHUTDOWN, \&Core::IRC::cmd_shutdown);
|
||||
API::Std::cmd_add("RESTART", 2, \%Core::IRC::SHELP_RESTART, \%Core::IRC::FHELP_RESTART, \&Core::IRC::cmd_restart);
|
||||
API::Std::cmd_add("HELP", 2, \%Core::IRC::SHELP_HELP, \%Core::IRC::FHELP_HELP, \&Core::IRC::cmd_help);
|
||||
API::Std::cmd_add("MODLOAD", 1, "cfunc.modules", \%Core::IRC::HELP_MODLOAD, \&Core::IRC::cmd_modload);
|
||||
API::Std::cmd_add("MODUNLOAD", 1, "cfunc.modules", \%Core::IRC::HELP_MODUNLOAD, \&Core::IRC::cmd_modunload);
|
||||
API::Std::cmd_add("MODRELOAD", 1, "cfunc.modules", \%Core::IRC::HELP_MODRELOAD, \&Core::IRC::cmd_modreload);
|
||||
API::Std::cmd_add("SHUTDOWN", 2, "cmd.shutdown", \%Core::IRC::HELP_SHUTDOWN, \&Core::IRC::cmd_shutdown);
|
||||
API::Std::cmd_add("RESTART", 2, "cmd.restart", \%Core::IRC::HELP_RESTART, \&Core::IRC::cmd_restart);
|
||||
API::Std::cmd_add("HELP", 2, 0, \%Core::IRC::HELP_HELP, \&Core::IRC::cmd_help);
|
||||
|
||||
# Infinite while loop.
|
||||
while (1) {
|
||||
|
||||
@@ -3,6 +3,9 @@ Auto IRC Bot 3.0: Change Log
|
||||
|
||||
3.0 Indev
|
||||
==================================================================
|
||||
* Updated Core::IRC and all modules to obey the updated API.
|
||||
* Deleted shelp from cmd_add, replaced with privilege. Renamed
|
||||
fhelp to help.
|
||||
* If fantasy HELP is used, only display fantasy commands, if
|
||||
private HELP is used, only display private commands.
|
||||
* Fixed cmd_add syntax. Correct format: name, level, short help,
|
||||
|
||||
+18
-36
@@ -24,11 +24,8 @@ sub version_reply
|
||||
}
|
||||
|
||||
|
||||
# Help hashes for MODLOAD. Spanish, French and German needed.
|
||||
our %SHELP_MODLOAD = (
|
||||
'en' => 'Load a module.',
|
||||
);
|
||||
our %FHELP_MODLOAD = (
|
||||
# Help hash for MODLOAD. Spanish, French and German needed.
|
||||
our %HELP_MODLOAD = (
|
||||
'en' => 'Loads a module into the running Auto live.',
|
||||
);
|
||||
# MODLOAD callback.
|
||||
@@ -71,11 +68,8 @@ sub cmd_modload
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Help hashes for MODUNLOAD. Spanish, French and German needed.
|
||||
our %SHELP_MODUNLOAD = (
|
||||
'en' => 'Unload a module.',
|
||||
);
|
||||
our %FHELP_MODUNLOAD = (
|
||||
# Help hash for MODUNLOAD. Spanish, French and German needed.
|
||||
our %HELP_MODUNLOAD = (
|
||||
'en' => 'Unloads a module from the running Auto live.',
|
||||
);
|
||||
# MODUNLOAD callback.
|
||||
@@ -118,11 +112,8 @@ sub cmd_modunload
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Help hashes for MODRELOAD. Spanish, French and German needed.
|
||||
our %SHELP_MODRELOAD = (
|
||||
'en' => 'Reload a module.',
|
||||
);
|
||||
our %FHELP_MODRELOAD = (
|
||||
# Help hash for MODRELOAD. Spanish, French and German needed.
|
||||
our %HELP_MODRELOAD = (
|
||||
'en' => 'Unloads then loads a module into the running Auto live.',
|
||||
);
|
||||
# MODRELOAD callback.
|
||||
@@ -167,11 +158,8 @@ sub cmd_modreload
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Help hashes for SHUTDOWN. Spanish, French and German needed.
|
||||
our %SHELP_SHUTDOWN = (
|
||||
'en' => 'Shutdown Auto.',
|
||||
);
|
||||
our %FHELP_SHUTDOWN = (
|
||||
# Help hash for SHUTDOWN. Spanish, French and German needed.
|
||||
our %HELP_SHUTDOWN = (
|
||||
'en' => 'This will send out shutdown notifications, quit all networks, flush the database then exit the program.',
|
||||
);
|
||||
# SHUTDOWN callback.
|
||||
@@ -198,11 +186,8 @@ sub cmd_shutdown
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Help hashes for RESTART. Spanish, French and German needed.
|
||||
our %SHELP_RESTART = (
|
||||
'en' => 'Restart Auto.',
|
||||
);
|
||||
our %FHELP_RESTART = (
|
||||
# Help hash for RESTART. Spanish, French and German needed.
|
||||
our %HELP_RESTART = (
|
||||
'en' => 'This will send out restart notifications, quit all networks, flush the database, start a new Auto process, then exit the program.',
|
||||
);
|
||||
# RESTART callback.
|
||||
@@ -237,11 +222,8 @@ sub cmd_restart
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Help hashes for HELP. Spanish, French and German needed.
|
||||
our %SHELP_HELP = (
|
||||
'en' => 'Displays help for commands.',
|
||||
);
|
||||
our %FHELP_HELP = (
|
||||
# Help hash for HELP. Spanish, French and German needed.
|
||||
our %HELP_HELP = (
|
||||
'en' => 'Displays help for commands.',
|
||||
);
|
||||
# HELP callback.
|
||||
@@ -274,23 +256,23 @@ sub cmd_help
|
||||
# Help for a specific command was requested. Lets get it.
|
||||
my $rcm = uc($argv[0]);
|
||||
|
||||
if (defined $API::Std::CMDS{$rcm}{fhelp}) {
|
||||
if (defined $API::Std::CMDS{$rcm}{help}) {
|
||||
# If there is help for this command.
|
||||
if ($API::Std::CMDS{$rcm}{fhelp}) {
|
||||
if ($API::Std::CMDS{$rcm}{help}) {
|
||||
# If there is valid help for this command.
|
||||
|
||||
# Get the language.
|
||||
my ($lang, undef) = split('_', $Auto::LOCALE);
|
||||
|
||||
if (defined ${ $API::Std::CMDS{$rcm}{fhelp} }{$lang}) {
|
||||
if (defined ${ $API::Std::CMDS{$rcm}{help} }{$lang}) {
|
||||
# If help for this command is available in the configured language.
|
||||
notice($data{svr}, $data{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{fhelp} }{$lang});
|
||||
notice($data{svr}, $data{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{$lang});
|
||||
}
|
||||
else {
|
||||
# If it isn't, default to English.
|
||||
if (defined ${ $API::Std::CMDS{$rcm}{fhelp} }{en}) {
|
||||
if (defined ${ $API::Std::CMDS{$rcm}{help} }{en}) {
|
||||
# If help for this command is available in English.
|
||||
notice($data{svr}, $data{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{fhelp} }{en});
|
||||
notice($data{svr}, $data{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{en});
|
||||
}
|
||||
else {
|
||||
# If it isn't, no help.
|
||||
|
||||
Reference in new issue
Block a user