config setting for command character

This commit is contained in:
Al Beano 2016-07-04 18:41:12 +01:00
parent 1ec86553fc
commit 9db303b811
2 changed files with 8 additions and 2 deletions

View File

@ -17,18 +17,19 @@ use MarkovBot::Commands;
sub said {
my $self = shift;
my $msg = shift;
my $command_char = config "command_character";
# Ignore PMs and ignored users
return if $msg->{channel} eq 'msg';
return if isIgnored($msg->{who});
# Intercept commands
if ($msg->{body} =~ m/^\.\w+/) {
if ($msg->{body} =~ m/^$command_char.+/) {
my $command = $msg->{body};
my @command = split(" ", $command);
my $bare = $command[0];
$bare =~ s/^\.//;
$bare =~ s/^$command_char//;
my %subs = %{getCommandSubs()};

View File

@ -1,3 +1,8 @@
#
# General settings
#
command_character: "."
#
# Redis Settings
#