3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

Do not /msg usage messages

This commit is contained in:
Pragmatic Software 2020-01-29 13:40:48 -08:00
parent 1a8e784b88
commit 77119ba978
3 changed files with 18 additions and 18 deletions

View File

@ -398,7 +398,7 @@ sub ban_user {
$channel = exists $stuff->{admin_channel_override} ? $stuff->{admin_channel_override} : $from if not defined $channel or not length $channel;
if (not defined $target) {
return "/msg $nick Usage: ban <mask> [channel [timeout (default: 24 hours)]]";
return "Usage: ban <mask> [channel [timeout (default: 24 hours)]]";
}
my $no_length = 0;
@ -419,7 +419,7 @@ sub ban_user {
return "I don't think so." if $target =~ /^\Q$botnick\E!/i;
if ($self->{pbot}->{commands}->get_meta($stuff->{keyword}, 'level') and not $stuff->{'effective-level'} and not $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host")) {
return "/msg $nick You are not an admin for $channel.";
return "You are not an admin for $channel.";
}
my $result = '';
@ -477,16 +477,16 @@ sub unban_user {
}
if (not defined $target) {
return "/msg $nick Usage: unban <nick/mask> [channel [false value to use unban queue]]";
return "Usage: unban <nick/mask> [channel [false value to use unban queue]]";
}
$channel = exists $stuff->{admin_channel_override} ? $stuff->{admin_channel_override} : $from if not defined $channel;
$immediately = 1 if not defined $immediately;
return "/msg $nick Usage for /msg: unban <nick/mask> <channel> [false value to use unban queue]" if $channel !~ /^#/;
return "Usage for /msg: unban <nick/mask> <channel> [false value to use unban queue]" if $channel !~ /^#/;
if ($self->{pbot}->{commands}->get_meta($stuff->{keyword}, 'level') and not $stuff->{'effective-level'} and not $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host")) {
return "/msg $nick You are not an admin for $channel.";
return "You are not an admin for $channel.";
}
my @targets = split /,/, $target;
@ -513,7 +513,7 @@ sub mute_user {
}
if (not defined $channel and $from !~ m/^#/) {
return "/msg $nick Usage from private message: mute <mask> <channel> [timeout (default: 24 hours)]";
return "Usage from private message: mute <mask> <channel> [timeout (default: 24 hours)]";
}
if ($channel !~ m/^#/) {
@ -525,11 +525,11 @@ sub mute_user {
$channel = exists $stuff->{admin_channel_override} ? $stuff->{admin_channel_override} : $from if not defined $channel;
if ($channel !~ m/^#/) {
return "/msg $nick Please specify a channel.";
return "Please specify a channel.";
}
if (not defined $target) {
return "/msg $nick Usage: mute <mask> [channel [timeout (default: 24 hours)]]";
return "Usage: mute <mask> [channel [timeout (default: 24 hours)]]";
}
my $no_length = 0;
@ -550,7 +550,7 @@ sub mute_user {
return "I don't think so." if $target =~ /^\Q$botnick\E!/i;
if ($self->{pbot}->{commands}->get_meta($stuff->{keyword}, 'level') and not $stuff->{'effective-level'} and not $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host")) {
return "/msg $nick You are not an admin for $channel.";
return "You are not an admin for $channel.";
}
my $result = '';
@ -608,16 +608,16 @@ sub unmute_user {
}
if (not defined $target) {
return "/msg $nick Usage: unmute <nick/mask> [channel [false value to use unban queue]]";
return "Usage: unmute <nick/mask> [channel [false value to use unban queue]]";
}
$channel = exists $stuff->{admin_channel_override} ? $stuff->{admin_channel_override} : $from if not defined $channel;
$immediately = 1 if not defined $immediately;
return "/msg $nick Usage for /msg: unmute <nick/mask> <channel> [false value to use unban queue]" if $channel !~ /^#/;
return "Usage for /msg: unmute <nick/mask> <channel> [false value to use unban queue]" if $channel !~ /^#/;
if ($self->{pbot}->{commands}->get_meta($stuff->{keyword}, 'level') and not $stuff->{'effective-level'} and not $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host")) {
return "/msg $nick You are not an admin for $channel.";
return "You are not an admin for $channel.";
}
my @targets = split /,/, $target;
@ -648,7 +648,7 @@ sub kick_user {
if (not $from =~ /^#/) {
# used in private message
if (not $arguments =~ s/^(^#\S+) (\S+)\s*//) {
return "/msg $nick Usage from private message: kick <channel> <nick> [reason]";
return "Usage from private message: kick <channel> <nick> [reason]";
}
($channel, $victim) = ($1, $2);
} else {
@ -658,7 +658,7 @@ sub kick_user {
} elsif ($arguments =~ s/^(\S+)\s*//) {
($victim, $channel) = ($1, exists $stuff->{admin_channel_override} ? $stuff->{admin_channel_override} : $from);
} else {
return "/msg $nick Usage: kick [channel] <nick> [reason]";
return "Usage: kick [channel] <nick> [reason]";
}
}
@ -671,7 +671,7 @@ sub kick_user {
}
if ($self->{pbot}->{commands}->get_meta($stuff->{keyword}, 'level') and not $stuff->{'effective-level'} and not $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host")) {
return "/msg $nick You are not an admin for $channel.";
return "You are not an admin for $channel.";
}
my @insults;

View File

@ -419,7 +419,7 @@ sub export {
my $self = shift;
my ($from, $nick, $user, $host, $arguments) = @_;
return "/msg $nick Usage: export <factoids>" if not defined $arguments;
return "Usage: export <factoids>" if not defined $arguments;
if ($arguments =~ /^factoids$/i) {
return $self->{factoids}->export_factoids;

View File

@ -347,7 +347,7 @@ sub useradd {
$level //= 0;
if (not defined $name or not defined $channel or not defined $hostmask) {
return "/msg $nick Usage: useradd <account name> <channel> <hostmask> [level [password]]";
return "Usage: useradd <account name> <channel> <hostmask> [level [password]]";
}
$channel = '.*' if $channel !~ /^#/;
@ -374,7 +374,7 @@ sub userdel {
my ($channel, $hostmask) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 2);
if (not defined $channel or not defined $hostmask) {
return "/msg $nick Usage: userdel <channel> <hostmask or account name>";
return "Usage: userdel <channel> <hostmask or account name>";
}
my ($found_channel, $found_hostmask) = $self->find_user_account($channel, $hostmask);