From 69a64286ce5e0ba0275e0f7d623a5c3b566a8e7c Mon Sep 17 00:00:00 2001 From: Matthew Barksdale Date: Fri, 4 Feb 2011 17:38:25 -0500 Subject: [PATCH] Unbroke modules that add commands to Auto. --- modules/Bitly.pm | 15 ++++----------- modules/Calc.pm | 6 +----- modules/EightBall.pm | 15 ++++----------- modules/IsItUp.pm | 8 ++------ modules/Weather.pm | 8 ++------ 5 files changed, 13 insertions(+), 39 deletions(-) diff --git a/modules/Bitly.pm b/modules/Bitly.pm index 268a350..4fc46c6 100644 --- a/modules/Bitly.pm +++ b/modules/Bitly.pm @@ -17,8 +17,8 @@ sub _init return 0; } # Create the SHORTEN and REVERSE commands. - cmd_add("SHORTEN", 0, \%m_Bitly::SHELP_SHORTEN, \%m_Bitly::FHELP_SHORTEN, \&m_Bitly::shorten) or return 0; - cmd_add("REVERSE", 0, \%m_Bitly::SHELP_REVERSE, \%m_Bitly::FHELP_REVERSE, \&m_Bitly::reverse) or return 0; + cmd_add("SHORTEN", 0, \%m_Bitly::HELP_SHORTEN, \&m_Bitly::shorten) or return 0; + cmd_add("REVERSE", 0, \%m_Bitly::HELP_REVERSE, \&m_Bitly::reverse) or return 0; # Success. return 1; @@ -36,17 +36,10 @@ sub _void } # Help hashes. -our %SHELP_SHORTEN = ( - 'en' => "Shorten an URL.", -); -our %SHELP_REVERSE = ( - 'en' => "Expand a shortened URL.", -); - -our %FHELP_SHORTEN = ( +our %HELP_SHORTEN = ( 'en' => "This command will shorten an URL using Bit.ly. Syntax: SHORTEN ", ); -our %FHELP_REVERSE = ( +our %HELP_REVERSE = ( 'en' => "This command will expand a Bit.ly URL. Syntax: REVERSE ", ); diff --git a/modules/Calc.pm b/modules/Calc.pm index 455064e..e245e2d 100644 --- a/modules/Calc.pm +++ b/modules/Calc.pm @@ -14,7 +14,7 @@ use JSON -support_by_pp; sub _init { # Create the CALC command. - cmd_add("CALC", 0, \%m_Calc::SHELP_CALC, \%m_Calc::FHELP_CALC, \&m_Calc::calc) or return 0; + cmd_add("CALC", 0, \%m_Calc::HELP_CALC, \&m_Calc::calc) or return 0; # Success. return 1; @@ -31,10 +31,6 @@ sub _void } # Help hashes. -our %SHELP_CALC = ( - 'en' => "Calculate an expression.", -); - our %FHELP_CALC = ( 'en' => "This command will calculate an expression using Google Calculator. Syntax: CALC ", ); diff --git a/modules/EightBall.pm b/modules/EightBall.pm index 3dc239a..7680446 100644 --- a/modules/EightBall.pm +++ b/modules/EightBall.pm @@ -13,8 +13,8 @@ our $ANSWER = 0; sub _init { # Create the 8BALL and RIGBALL commands. - cmd_add("8BALL", 0, \%m_EightBall::SHELP_8BALL, \%m_EightBall::FHELP_8BALL, \&m_EightBall::c_8ball) or return 0; - cmd_add("RIGBALL", 1, \%m_EightBall::SHELP_RIGBALL, \%m_EightBall::FHELP_RIGBALL, \&m_EightBall::rigball) or return 0; + cmd_add("8BALL", 0, \%m_EightBall::HELP_8BALL, \&m_EightBall::c_8ball) or return 0; + cmd_add("RIGBALL", 1, \%m_EightBall::HELP_RIGBALL, \&m_EightBall::rigball) or return 0; # Success. return 1; @@ -32,17 +32,10 @@ sub _void } # Help hashes. -our %SHELP_8BALL = ( - 'en' => "Ask the magic 8-Ball a question.", -); -our %SHELP_RIGBALL = ( - 'en' => "Set the next answer of the 8-Ball.", -); - -our %FHELP_8BALL = ( +our %HELP_8BALL = ( 'en' => "This command will ask the magic 8-Ball your question. Syntax: 8BALL ", ); -our %FHELP_RIGBALL = ( +our %HELP_RIGBALL = ( 'en' => "This command will \"rig\" (set) the answer of the next 8-Ball question. Syntax: RIGBALL ", ); diff --git a/modules/IsItUp.pm b/modules/IsItUp.pm index 05623d9..54f63a6 100644 --- a/modules/IsItUp.pm +++ b/modules/IsItUp.pm @@ -12,7 +12,7 @@ use LWP::UserAgent; sub _init { # Create the ISITUP command. - cmd_add("ISITUP", 0, \%m_IsItUp::SHELP_ISITUP, \%m_IsItUp::FHELP_ISITUP, \&m_IsItUp::check) or return 0; + cmd_add("ISITUP", 0, \%m_IsItUp::HELP_ISITUP, \&m_IsItUp::check) or return 0; # Success. return 1; @@ -29,11 +29,7 @@ sub _void } # Help hashes. -our %SHELP_ISITUP = ( - 'en' => "Checks if a website is up.", - ); - -our %FHELP_ISITUP = ( +our %HELP_ISITUP = ( 'en' => "This command will check if a website appears up or down to the bot. Syntax: ISITUP ", ); diff --git a/modules/Weather.pm b/modules/Weather.pm index e13718f..299f7e4 100644 --- a/modules/Weather.pm +++ b/modules/Weather.pm @@ -13,7 +13,7 @@ use XML::Simple; sub _init { # Create the Weather command. - cmd_add("WEATHER", 0, \%m_Weather::SHELP_WEATHER, \%m_Weather::FHELP_WEATHER, \&m_Weather::weather) or return 0; + cmd_add("WEATHER", 0, \%m_Weather::HELP_WEATHER, \&m_Weather::weather) or return 0; # Success. return 1; @@ -30,11 +30,7 @@ sub _void } # Help hashes. -our %SHELP_WEATHER = ( - 'en' => "Retrieve the weather.", - ); - -our %FHELP_WEATHER = ( +our %HELP_WEATHER = ( 'en' => "This command will retrieve the weather via Wunderground for the specified location. Syntax: WEATHER ", );