Update Core::IRC and CHANGELOG.

This commit is contained in:
Elijah Perrault committed 2011-02-04 15:39:32 -07:00
1 parent 69a64286ce
commit 26164f6006
3 files changed
+27 -42

No files matched your search

+6 -6
View File
@@ -293,12 +293,12 @@ undef $it;
# Create core hooks. # Create core hooks.
API::Std::hook_add("on_uprivmsg", "ctcp_version_reply", \&Core::IRC::version_reply); API::Std::hook_add("on_uprivmsg", "ctcp_version_reply", \&Core::IRC::version_reply);
# Create core commands. # 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("MODLOAD", 1, "cfunc.modules", \%Core::IRC::HELP_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("MODUNLOAD", 1, "cfunc.modules", \%Core::IRC::HELP_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("MODRELOAD", 1, "cfunc.modules", \%Core::IRC::HELP_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("SHUTDOWN", 2, "cmd.shutdown", \%Core::IRC::HELP_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("RESTART", 2, "cmd.restart", \%Core::IRC::HELP_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("HELP", 2, 0, \%Core::IRC::HELP_HELP, \&Core::IRC::cmd_help);
# Infinite while loop. # Infinite while loop.
while (1) { while (1) {
+3
View File
@@ -3,6 +3,9 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev 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 * If fantasy HELP is used, only display fantasy commands, if
private HELP is used, only display private commands. private HELP is used, only display private commands.
* Fixed cmd_add syntax. Correct format: name, level, short help, * Fixed cmd_add syntax. Correct format: name, level, short help,
+18 -36
View File
@@ -24,11 +24,8 @@ sub version_reply
} }
# Help hashes for MODLOAD. Spanish, French and German needed. # Help hash for MODLOAD. Spanish, French and German needed.
our %SHELP_MODLOAD = ( our %HELP_MODLOAD = (
'en' => 'Load a module.',
);
our %FHELP_MODLOAD = (
'en' => 'Loads a module into the running Auto live.', 'en' => 'Loads a module into the running Auto live.',
); );
# MODLOAD callback. # MODLOAD callback.
@@ -71,11 +68,8 @@ sub cmd_modload
return 1; return 1;
} }
# Help hashes for MODUNLOAD. Spanish, French and German needed. # Help hash for MODUNLOAD. Spanish, French and German needed.
our %SHELP_MODUNLOAD = ( our %HELP_MODUNLOAD = (
'en' => 'Unload a module.',
);
our %FHELP_MODUNLOAD = (
'en' => 'Unloads a module from the running Auto live.', 'en' => 'Unloads a module from the running Auto live.',
); );
# MODUNLOAD callback. # MODUNLOAD callback.
@@ -118,11 +112,8 @@ sub cmd_modunload
return 1; return 1;
} }
# Help hashes for MODRELOAD. Spanish, French and German needed. # Help hash for MODRELOAD. Spanish, French and German needed.
our %SHELP_MODRELOAD = ( our %HELP_MODRELOAD = (
'en' => 'Reload a module.',
);
our %FHELP_MODRELOAD = (
'en' => 'Unloads then loads a module into the running Auto live.', 'en' => 'Unloads then loads a module into the running Auto live.',
); );
# MODRELOAD callback. # MODRELOAD callback.
@@ -167,11 +158,8 @@ sub cmd_modreload
return 1; return 1;
} }
# Help hashes for SHUTDOWN. Spanish, French and German needed. # Help hash for SHUTDOWN. Spanish, French and German needed.
our %SHELP_SHUTDOWN = ( our %HELP_SHUTDOWN = (
'en' => 'Shutdown Auto.',
);
our %FHELP_SHUTDOWN = (
'en' => 'This will send out shutdown notifications, quit all networks, flush the database then exit the program.', 'en' => 'This will send out shutdown notifications, quit all networks, flush the database then exit the program.',
); );
# SHUTDOWN callback. # SHUTDOWN callback.
@@ -198,11 +186,8 @@ sub cmd_shutdown
return 1; return 1;
} }
# Help hashes for RESTART. Spanish, French and German needed. # Help hash for RESTART. Spanish, French and German needed.
our %SHELP_RESTART = ( our %HELP_RESTART = (
'en' => 'Restart Auto.',
);
our %FHELP_RESTART = (
'en' => 'This will send out restart notifications, quit all networks, flush the database, start a new Auto process, then exit the program.', 'en' => 'This will send out restart notifications, quit all networks, flush the database, start a new Auto process, then exit the program.',
); );
# RESTART callback. # RESTART callback.
@@ -237,11 +222,8 @@ sub cmd_restart
return 1; return 1;
} }
# Help hashes for HELP. Spanish, French and German needed. # Help hash for HELP. Spanish, French and German needed.
our %SHELP_HELP = ( our %HELP_HELP = (
'en' => 'Displays help for commands.',
);
our %FHELP_HELP = (
'en' => 'Displays help for commands.', 'en' => 'Displays help for commands.',
); );
# HELP callback. # HELP callback.
@@ -274,23 +256,23 @@ 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 (defined $API::Std::CMDS{$rcm}{fhelp}) { if (defined $API::Std::CMDS{$rcm}{help}) {
# If there is help for this command. # 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. # 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 (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. # 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 { else {
# If it isn't, default to English. # 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. # 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 { else {
# If it isn't, no help. # If it isn't, no help.