Removing return 0's as it's improper.
This commit is contained in:
1 parent
374b04fddc
commit
8a8166bdb8
9 files changed
+32
-32
No files matched your search
+1
-1
@@ -27,7 +27,7 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the act_on_badword hook.
|
# Delete the act_on_badword hook.
|
||||||
hook_del('act_on_badword') or return 0;
|
hook_del('act_on_badword') or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
+7
-7
@@ -15,11 +15,11 @@ sub _init
|
|||||||
# Check for required configuration values.
|
# Check for required configuration values.
|
||||||
if (!(conf_get('bitly:user'))[0][0] or !(conf_get('bitly:key'))[0][0]) {
|
if (!(conf_get('bitly:user'))[0][0] or !(conf_get('bitly:key'))[0][0]) {
|
||||||
err(2, 'Please verify that you have bitly_user and bitly_key defined in your configuration file.', 0);
|
err(2, 'Please verify that you have bitly_user and bitly_key defined in your configuration file.', 0);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
# Create the SHORTEN and REVERSE commands.
|
# Create the SHORTEN and REVERSE commands.
|
||||||
cmd_add('SHORTEN', 0, 0, \%M::Bitly::HELP_SHORTEN, \&M::Bitly::shorten) or return 0;
|
cmd_add('SHORTEN', 0, 0, \%M::Bitly::HELP_SHORTEN, \&M::Bitly::shorten) or return;
|
||||||
cmd_add('REVERSE', 0, 0, \%M::Bitly::HELP_REVERSE, \&M::Bitly::reverse) or return 0;
|
cmd_add('REVERSE', 0, 0, \%M::Bitly::HELP_REVERSE, \&M::Bitly::reverse) or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -29,8 +29,8 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the SHORTEN and REVERSE commands.
|
# Delete the SHORTEN and REVERSE commands.
|
||||||
cmd_del('SHORTEN') or return 0;
|
cmd_del('SHORTEN') or return;
|
||||||
cmd_del('REVERSE') or return 0;
|
cmd_del('REVERSE') or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -57,7 +57,7 @@ sub shorten
|
|||||||
# Put together the call to the Bit.ly API.
|
# Put together the call to the Bit.ly API.
|
||||||
if (!defined $args[0]) {
|
if (!defined $args[0]) {
|
||||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
my ($surl, $user, $key) = ($args[0], (conf_get('bitly:user'))[0][0], (conf_get('bitly:key'))[0][0]);
|
my ($surl, $user, $key) = ($args[0], (conf_get('bitly:user'))[0][0], (conf_get('bitly:key'))[0][0]);
|
||||||
$surl = uri_escape($surl);
|
$surl = uri_escape($surl);
|
||||||
@@ -93,7 +93,7 @@ sub reverse
|
|||||||
# Put together the call to the Bit.ly API.
|
# Put together the call to the Bit.ly API.
|
||||||
if (!defined $args[0]) {
|
if (!defined $args[0]) {
|
||||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
my ($surl, $user, $key) = ($args[0], (conf_get('bitly:user'))[0][0], (conf_get('bitly:key'))[0][0]);
|
my ($surl, $user, $key) = ($args[0], (conf_get('bitly:user'))[0][0], (conf_get('bitly:key'))[0][0]);
|
||||||
$surl = uri_escape($surl);
|
$surl = uri_escape($surl);
|
||||||
|
|||||||
+3
-3
@@ -14,7 +14,7 @@ use JSON -support_by_pp;
|
|||||||
sub _init
|
sub _init
|
||||||
{
|
{
|
||||||
# Create the CALC command.
|
# Create the CALC command.
|
||||||
cmd_add("CALC", 0, 0, \%M::Calc::HELP_CALC, \&M::Calc::calc) or return 0;
|
cmd_add("CALC", 0, 0, \%M::Calc::HELP_CALC, \&M::Calc::calc) or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -24,7 +24,7 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the CALC command.
|
# Delete the CALC command.
|
||||||
cmd_del("CALC") or return 0;
|
cmd_del("CALC") or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -49,7 +49,7 @@ sub calc
|
|||||||
# Put together the call to the Google Calculator API.
|
# Put together the call to the Google Calculator API.
|
||||||
if (!defined $args[0]) {
|
if (!defined $args[0]) {
|
||||||
notice($src->{svr}, $src->{nick}, trans("Not enough parameters").".");
|
notice($src->{svr}, $src->{nick}, trans("Not enough parameters").".");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
my $expr = join(' ', @args);
|
my $expr = join(' ', @args);
|
||||||
my $url = "http://www.google.com/ig/calculator?q=".uri_escape($expr);
|
my $url = "http://www.google.com/ig/calculator?q=".uri_escape($expr);
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ my @responses = (
|
|||||||
# Initialization subroutine.
|
# Initialization subroutine.
|
||||||
sub _init {
|
sub _init {
|
||||||
# Create the 8BALL and RIGBALL commands.
|
# Create the 8BALL and RIGBALL commands.
|
||||||
cmd_add('8BALL', 0, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return 0;
|
cmd_add('8BALL', 0, 0, \%M::EightBall::HELP_8BALL, \&M::EightBall::c_8ball) or return;
|
||||||
cmd_add('RIGBALL', 1, 'cmd.rigball', \%M::EightBall::HELP_RIGBALL, \&M::EightBall::rigball) or return 0;
|
cmd_add('RIGBALL', 1, 'cmd.rigball', \%M::EightBall::HELP_RIGBALL, \&M::EightBall::rigball) or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -36,8 +36,8 @@ sub _init {
|
|||||||
# Void subroutine.
|
# Void subroutine.
|
||||||
sub _void {
|
sub _void {
|
||||||
# Delete the 8BALL and RIGBALL commands.
|
# Delete the 8BALL and RIGBALL commands.
|
||||||
cmd_del('8BALL') or return 0;
|
cmd_del('8BALL') or return;
|
||||||
cmd_del('RIGBALL') or return 0;
|
cmd_del('RIGBALL') or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
+2
-2
@@ -12,7 +12,7 @@ use LWP::UserAgent;
|
|||||||
sub _init
|
sub _init
|
||||||
{
|
{
|
||||||
# Create the FML command.
|
# Create the FML command.
|
||||||
cmd_add('FML', 0, 0, \%M::FML::HELP_FML, \&M::FML::fml) or return 0;
|
cmd_add('FML', 0, 0, \%M::FML::HELP_FML, \&M::FML::fml) or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -22,7 +22,7 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the FML command.
|
# Delete the FML command.
|
||||||
cmd_del('FML') or return 0;
|
cmd_del('FML') or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use API::IRC qw(privmsg);
|
|||||||
sub _init
|
sub _init
|
||||||
{
|
{
|
||||||
# Add a hook for when we join a channel.
|
# Add a hook for when we join a channel.
|
||||||
hook_add('on_ucjoin', 'HelloChan', \&M::HelloChan::hello) or return 0;
|
hook_add('on_ucjoin', 'HelloChan', \&M::HelloChan::hello) or return;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the hook.
|
# Delete the hook.
|
||||||
hook_del('on_ucjoin', 'HelloChan') or return 0;
|
hook_del('on_ucjoin', 'HelloChan') or return;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,7 @@ use LWP::UserAgent;
|
|||||||
sub _init
|
sub _init
|
||||||
{
|
{
|
||||||
# Create the ISITUP command.
|
# Create the ISITUP command.
|
||||||
cmd_add('ISITUP', 0, 0, \%M::IsItUp::HELP_ISITUP, \&M::IsItUp::check) or return 0;
|
cmd_add('ISITUP', 0, 0, \%M::IsItUp::HELP_ISITUP, \&M::IsItUp::check) or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -22,7 +22,7 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the ISITUP command.
|
# Delete the ISITUP command.
|
||||||
cmd_del('ISITUP') or return 0;
|
cmd_del('ISITUP') or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -45,7 +45,7 @@ sub check
|
|||||||
# Do we have enough parameters?
|
# Do we have enough parameters?
|
||||||
if (!defined $argv[0]) {
|
if (!defined $argv[0]) {
|
||||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').q{.});
|
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').q{.});
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
my $curl = $argv[0];
|
my $curl = $argv[0];
|
||||||
# Does the URL start with http(s)?
|
# Does the URL start with http(s)?
|
||||||
|
|||||||
+7
-7
@@ -11,9 +11,9 @@ use API::Log qw(alog);
|
|||||||
sub _init
|
sub _init
|
||||||
{
|
{
|
||||||
# Add a hook for when we join a channel.
|
# Add a hook for when we join a channel.
|
||||||
hook_add('on_connect', 'Oper.onconnect', \&M::Oper::on_connect) or return 0;
|
hook_add('on_connect', 'Oper.onconnect', \&M::Oper::on_connect) or return;
|
||||||
# Add a hook for when we get numeric 491 (ERR_NOOPERHOST)
|
# Add a hook for when we get numeric 491 (ERR_NOOPERHOST)
|
||||||
rchook_add('491', 'Oper.on381', \&M::Oper::on_num491) or return 0;
|
rchook_add('491', 'Oper.on381', \&M::Oper::on_num491) or return;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +21,10 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the hooks.
|
# Delete the hooks.
|
||||||
hook_del('on_connect', 'Oper.onconnect') or return 0;
|
hook_del('on_connect', 'Oper.onconnect') or return;
|
||||||
rchook_del('381', 'Oper.on381') or return 0;
|
rchook_del('381', 'Oper.on381') or return;
|
||||||
rchook_del('313', 'Oper.on313') or return 0;
|
rchook_del('313', 'Oper.on313') or return;
|
||||||
rchook_del('491', 'Oper.on491') or return 0;
|
rchook_del('491', 'Oper.on491') or return;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ sub on_num491 {
|
|||||||
sub is_opered {
|
sub is_opered {
|
||||||
my ($svr) = @_;
|
my ($svr) = @_;
|
||||||
# Auto is not opered.
|
# Auto is not opered.
|
||||||
return 0 if $Proto::IRC::botinfo{$svr}{modes} !~ m/o/xsm;
|
return if $Proto::IRC::botinfo{$svr}{modes} !~ m/o/xsm;
|
||||||
# Auto is opered.
|
# Auto is opered.
|
||||||
return 1 if $Proto::IRC::botinfo{$svr}{modes} =~ m/o/xsm;
|
return 1 if $Proto::IRC::botinfo{$svr}{modes} =~ m/o/xsm;
|
||||||
return;
|
return;
|
||||||
|
|||||||
+3
-3
@@ -13,7 +13,7 @@ use XML::Simple;
|
|||||||
sub _init
|
sub _init
|
||||||
{
|
{
|
||||||
# Create the Weather command.
|
# Create the Weather command.
|
||||||
cmd_add('WEATHER', 0, 0, \%M::Weather::HELP_WEATHER, \&M::Weather::weather) or return 0;
|
cmd_add('WEATHER', 0, 0, \%M::Weather::HELP_WEATHER, \&M::Weather::weather) or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -23,7 +23,7 @@ sub _init
|
|||||||
sub _void
|
sub _void
|
||||||
{
|
{
|
||||||
# Delete the Weather command.
|
# Delete the Weather command.
|
||||||
cmd_del('WEATHER') or return 0;
|
cmd_del('WEATHER') or return;
|
||||||
|
|
||||||
# Success.
|
# Success.
|
||||||
return 1;
|
return 1;
|
||||||
@@ -46,7 +46,7 @@ sub weather
|
|||||||
# Put together the call to the Wunderground API.
|
# Put together the call to the Wunderground API.
|
||||||
if (!defined $args[0]) {
|
if (!defined $args[0]) {
|
||||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
my $loc = join(' ', @args);
|
my $loc = join(' ', @args);
|
||||||
$loc =~ s/ /%20/g;
|
$loc =~ s/ /%20/g;
|
||||||
|
|||||||
Reference in new issue
Block a user