mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-02 15:34:05 +01:00
Do not do me/my expansion for a few more commands
This commit is contained in:
parent
c7e40a25ec
commit
4f54ee669c
@ -298,7 +298,7 @@ sub interpret {
|
|||||||
|
|
||||||
$stuff->{nickoverride} = $stuff->{nick} if defined $stuff->{nickoverride} and lc $stuff->{nickoverride} eq 'me';
|
$stuff->{nickoverride} = $stuff->{nick} if defined $stuff->{nickoverride} and lc $stuff->{nickoverride} eq 'me';
|
||||||
|
|
||||||
if ($keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl|spinach|choose|c|lie|l|adminadd)$/) {
|
if ($keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl|ban|mute|spinach|choose|c|lie|l|adminadd|unmute|unban)$/) {
|
||||||
$keyword =~ s/(\w+)([?!.]+)$/$1/;
|
$keyword =~ s/(\w+)([?!.]+)$/$1/;
|
||||||
$arguments =~ s/(?<![\w\/\-\\])i am\b/$stuff->{nick} is/gi if defined $arguments && $stuff->{interpret_depth} <= 2;
|
$arguments =~ s/(?<![\w\/\-\\])i am\b/$stuff->{nick} is/gi if defined $arguments && $stuff->{interpret_depth} <= 2;
|
||||||
$arguments =~ s/(?<![\w\/\-\\])me\b/$stuff->{nick}/gi if defined $arguments && $stuff->{interpret_depth} <= 2;
|
$arguments =~ s/(?<![\w\/\-\\])me\b/$stuff->{nick}/gi if defined $arguments && $stuff->{interpret_depth} <= 2;
|
||||||
@ -514,16 +514,17 @@ sub output_result {
|
|||||||
return if not defined $line or not length $line;
|
return if not defined $line or not length $line;
|
||||||
|
|
||||||
if ($line =~ s/^\/say\s+//i) {
|
if ($line =~ s/^\/say\s+//i) {
|
||||||
|
|
||||||
if (defined $stuff->{nickoverride} and ($stuff->{no_nickoverride} == 0 or $stuff->{force_nickoverride} == 1)) {
|
if (defined $stuff->{nickoverride} and ($stuff->{no_nickoverride} == 0 or $stuff->{force_nickoverride} == 1)) {
|
||||||
$line = "$stuff->{nickoverride}: $line";
|
$line = "$stuff->{nickoverride}: $line";
|
||||||
}
|
}
|
||||||
$pbot->{conn}->privmsg($stuff->{from}, $line) if defined $stuff->{from} && $stuff->{from} !~ /\Q$botnick\E/i;
|
$pbot->{conn}->privmsg($stuff->{from}, $line) if defined $stuff->{from} && $stuff->{from} !~ /\Q$botnick\E/i;
|
||||||
$pbot->{antiflood}->check_flood($stuff->{from}, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', $line, 0, 0, 0) if $stuff->{checkflood};
|
$pbot->{antiflood}->check_flood($stuff->{from}, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', $line, 0, 0, 0) if $stuff->{checkflood};
|
||||||
} elsif ($line =~ s/^\/me\s+//i) {
|
} elsif ($line =~ s/^\/me\s+//i) {
|
||||||
|
=cut
|
||||||
if (defined $stuff->{nickoverride}) {
|
if (defined $stuff->{nickoverride}) {
|
||||||
$line = "$line (for $stuff->{nickoverride})";
|
$line = "$line (for $stuff->{nickoverride})";
|
||||||
}
|
}
|
||||||
|
=cut
|
||||||
$pbot->{conn}->me($stuff->{from}, $line) if defined $stuff->{from} && $stuff->{from} !~ /\Q$botnick\E/i;
|
$pbot->{conn}->me($stuff->{from}, $line) if defined $stuff->{from} && $stuff->{from} !~ /\Q$botnick\E/i;
|
||||||
$pbot->{antiflood}->check_flood($stuff->{from}, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', '/me ' . $line, 0, 0, 0) if $stuff->{checkflood};
|
$pbot->{antiflood}->check_flood($stuff->{from}, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', '/me ' . $line, 0, 0, 0) if $stuff->{checkflood};
|
||||||
} elsif ($line =~ s/^\/msg\s+([^\s]+)\s+//i) {
|
} elsif ($line =~ s/^\/msg\s+([^\s]+)\s+//i) {
|
||||||
@ -533,9 +534,11 @@ sub output_result {
|
|||||||
} elsif ($to =~ /.*serv(?:@.*)?$/i) {
|
} elsif ($to =~ /.*serv(?:@.*)?$/i) {
|
||||||
$pbot->{logger}->log("[HACK] Possible HACK ATTEMPT /msg *serv: [$stuff->{nick}!$stuff->{user}\@$stuff->{host}] [$stuff->{command}] [$line]\n");
|
$pbot->{logger}->log("[HACK] Possible HACK ATTEMPT /msg *serv: [$stuff->{nick}!$stuff->{user}\@$stuff->{host}] [$stuff->{command}] [$line]\n");
|
||||||
} elsif ($line =~ s/^\/me\s+//i) {
|
} elsif ($line =~ s/^\/me\s+//i) {
|
||||||
|
=cut
|
||||||
if (defined $stuff->{nickoverride}) {
|
if (defined $stuff->{nickoverride}) {
|
||||||
$line = "$line (for $stuff->{nickoverride})";
|
$line = "$line (for $stuff->{nickoverride})";
|
||||||
}
|
}
|
||||||
|
=cut
|
||||||
$pbot->{conn}->me($to, $line) if $to !~ /\Q$botnick\E/i;
|
$pbot->{conn}->me($to, $line) if $to !~ /\Q$botnick\E/i;
|
||||||
$pbot->{antiflood}->check_flood($to, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', '/me ' . $line, 0, 0, 0) if $stuff->{checkflood};
|
$pbot->{antiflood}->check_flood($to, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', '/me ' . $line, 0, 0, 0) if $stuff->{checkflood};
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user