mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 11:42:35 +01:00
Add support for per-channel bot trigger characters
This commit is contained in:
parent
2e9f15b7e2
commit
44bdf26ebc
@ -69,12 +69,17 @@ sub process_line {
|
||||
my $cmd_text = $text;
|
||||
$cmd_text =~ s/^\/me\s+//;
|
||||
|
||||
my $bot_trigger = $pbot->{registry}->get_value('general', 'trigger');
|
||||
# get channel-specific trigger if available
|
||||
my $bot_trigger = $pbot->{registry}->get_value($from, 'trigger');
|
||||
|
||||
if (not defined $bot_trigger) {
|
||||
$bot_trigger = $pbot->{registry}->get_value('general', 'trigger');
|
||||
}
|
||||
|
||||
if($cmd_text =~ /^$bot_trigger?\s*{\s*(.*)\s*}\s*$/) {
|
||||
$has_code = $1 if length $1;
|
||||
$preserve_whitespace = 1;
|
||||
} elsif($cmd_text =~ /^\Q$bot_trigger\E(.*)$/) {
|
||||
} elsif($cmd_text =~ /^$bot_trigger(.*)$/) {
|
||||
$command = $1;
|
||||
} elsif($cmd_text =~ /^.?$mynick.?\s+(.*?)$/i) {
|
||||
$command = $1;
|
||||
|
Loading…
Reference in New Issue
Block a user