mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-23 18:44:33 +01:00
Correct handling of tell
ing factoid aliases
This commit is contained in:
parent
b38456e411
commit
789a4bfe2d
@ -466,6 +466,19 @@ sub interpreter {
|
||||
}
|
||||
}
|
||||
|
||||
# Check if it's an alias
|
||||
if($action =~ /^\/call\s+(.*)$/) {
|
||||
my $command;
|
||||
if(length $arguments) {
|
||||
$command = "$1 $arguments";
|
||||
} else {
|
||||
$command = $1;
|
||||
}
|
||||
|
||||
$pbot->{logger}->log("[" . (defined $from ? $from : "stdin") . "] ($nick!$user\@$host) [$keyword] aliased to: [$command]\n");
|
||||
return $pbot->{interpreter}->interpret($from, $nick, $user, $host, $depth, $command, $tonick);
|
||||
}
|
||||
|
||||
if(defined $tonick) { # !tell foo about bar
|
||||
$self->{pbot}->{logger}->log("($from): $nick!$user\@$host) sent to $tonick\n");
|
||||
my $botnick = $self->{pbot}->{registry}->get_value('irc', 'botnick');
|
||||
@ -511,19 +524,6 @@ sub interpreter {
|
||||
|
||||
$action =~ s/\\\$/\$/g;
|
||||
|
||||
# Check if it's an alias
|
||||
if($action =~ /^\/call\s+(.*)$/) {
|
||||
my $command;
|
||||
if(length $arguments) {
|
||||
$command = "$1 $arguments";
|
||||
} else {
|
||||
$command = $1;
|
||||
}
|
||||
|
||||
$pbot->{logger}->log("[" . (defined $from ? $from : "stdin") . "] ($nick!$user\@$host) [$keyword] aliased to: [$command]\n");
|
||||
return $pbot->{interpreter}->interpret($from, $nick, $user, $host, $depth, $command, $tonick);
|
||||
}
|
||||
|
||||
if($self->{factoids}->hash->{$channel}->{$keyword}->{enabled} == 0) {
|
||||
$self->{pbot}->{logger}->log("$keyword disabled.\n");
|
||||
return "/msg $nick $ref_from$keyword is currently disabled.";
|
||||
|
Loading…
Reference in New Issue
Block a user