config setting for command character
This commit is contained in:
parent
1ec86553fc
commit
9db303b811
|
@ -17,18 +17,19 @@ use MarkovBot::Commands;
|
||||||
sub said {
|
sub said {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $msg = shift;
|
my $msg = shift;
|
||||||
|
my $command_char = config "command_character";
|
||||||
|
|
||||||
# Ignore PMs and ignored users
|
# Ignore PMs and ignored users
|
||||||
return if $msg->{channel} eq 'msg';
|
return if $msg->{channel} eq 'msg';
|
||||||
return if isIgnored($msg->{who});
|
return if isIgnored($msg->{who});
|
||||||
|
|
||||||
# Intercept commands
|
# Intercept commands
|
||||||
if ($msg->{body} =~ m/^\.\w+/) {
|
if ($msg->{body} =~ m/^$command_char.+/) {
|
||||||
|
|
||||||
my $command = $msg->{body};
|
my $command = $msg->{body};
|
||||||
my @command = split(" ", $command);
|
my @command = split(" ", $command);
|
||||||
my $bare = $command[0];
|
my $bare = $command[0];
|
||||||
$bare =~ s/^\.//;
|
$bare =~ s/^$command_char//;
|
||||||
|
|
||||||
my %subs = %{getCommandSubs()};
|
my %subs = %{getCommandSubs()};
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
#
|
||||||
|
# General settings
|
||||||
|
#
|
||||||
|
command_character: "."
|
||||||
|
|
||||||
#
|
#
|
||||||
# Redis Settings
|
# Redis Settings
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue