3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 12:29:27 +01:00

Use botnick instead of trigger for stdin commands

Since trigger can be set to be a regex or character-class, use
botnick instead to ensure that commands are properly interpreted.
This commit is contained in:
Pragmatic Software 2015-04-19 01:53:46 -07:00
parent 778933caad
commit 4bda217774

View File

@ -43,10 +43,10 @@ sub stdin_reader {
if($input =~ m/^~([^ ]+)\s+(.*)/) { if($input =~ m/^~([^ ]+)\s+(.*)/) {
$from = $1; $from = $1;
$text = $self->{pbot}->{registry}->get_value('general', 'trigger') . $2; $text = $self->{pbot}->{registry}->get_value('irc', 'botnick') . " $2";
} else { } else {
$from = $self->{pbot}->{registry}->get_value('irc', 'botnick') . "!stdin\@localhost"; $from = $self->{pbot}->{registry}->get_value('irc', 'botnick') . "!stdin\@localhost";
$text = $self->{pbot}->{registry}->get_value('general', 'trigger') . $input; $text = $self->{pbot}->{registry}->get_value('irc', 'botnick') . " $input";
} }
return $self->{pbot}->{interpreter}->process_line($from, $self->{pbot}->{registry}->get_value('irc', 'botnick'), "stdin", "localhost", $text); return $self->{pbot}->{interpreter}->process_line($from, $self->{pbot}->{registry}->get_value('irc', 'botnick'), "stdin", "localhost", $text);