mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-25 19:44:26 +01:00
Improve the bot's understanding of "me" and "my"
This commit is contained in:
parent
74fe574332
commit
e723379c4d
@ -202,18 +202,14 @@ sub interpret {
|
|||||||
$keyword = $command;
|
$keyword = $command;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($keyword ne "factadd"
|
$tonick = $nick if $tonick eq 'me';
|
||||||
and $keyword ne "add"
|
|
||||||
and $keyword ne "factfind"
|
if ($keyword !~ /^(factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell)/) {
|
||||||
and $keyword ne "find"
|
|
||||||
and $keyword ne "factshow"
|
|
||||||
and $keyword ne "show"
|
|
||||||
and $keyword ne "factset"
|
|
||||||
and $keyword ne "factchange"
|
|
||||||
and $keyword ne "change"
|
|
||||||
and $keyword ne "msg") {
|
|
||||||
$keyword =~ s/(\w+)([?!.]+)$/$1/;
|
$keyword =~ s/(\w+)([?!.]+)$/$1/;
|
||||||
$arguments =~ s/(?<![\w\/\-])me\b/$nick/gi if defined $arguments && $depth <= 2;
|
$arguments =~ s/(?<![\w\/\-\\])me\b/$nick/gi if defined $arguments && $depth <= 2;
|
||||||
|
$arguments =~ s/(?<![\w\/\-\\])my\b/${nick}'s/gi if defined $arguments && $depth <= 2;
|
||||||
|
$arguments =~ s/\\my\b/my/gi if defined $arguments && $depth <= 2;
|
||||||
|
$arguments =~ s/\\me\b/me/gi if defined $arguments && $depth <= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $botnick = $self->{pbot}->{registry}->get_value('irc', 'botnick');
|
my $botnick = $self->{pbot}->{registry}->get_value('irc', 'botnick');
|
||||||
|
Loading…
Reference in New Issue
Block a user