experimental multichannel support

This commit is contained in:
Al Beano 2016-09-04 11:31:33 +01:00
parent 64a14dae03
commit ab7ee6338e
2 changed files with 9 additions and 6 deletions

View File

@ -46,7 +46,7 @@ sub said {
if (defined $subs{$bare}) {
my $ret = $subs{$bare}->(\@command);
$self->say( channel => config("irc_channel"), body => decode("UTF-8", $ret) ) unless $ret eq "___null___";
$self->say( channel => $msg->{"channel"}, body => decode("UTF-8", $ret) ) unless $ret eq "___null___";
}
return;
@ -66,13 +66,13 @@ sub said {
}
}
$self->say(
channel => config("irc_channel"),
channel => $msg->{"channel"},
body => $ret,
);
}
if ($msg->{body} =~ m/^ayy+$/) {
$self->say(
channel => config("irc_channel"),
channel => $msg->{"channel"},
body => "lmao",
);
}
@ -100,7 +100,7 @@ sub said {
}
$self->say(
channel => config("irc_channel"),
channel => $msg->{"channel"},
body => $resp,
) if $resp;
}
@ -121,7 +121,7 @@ MarkovBot->new(
server => config("irc_server"),
port => config("irc_port"),
channels => [config("irc_channel")],
channels => config("irc_channels"),
nick => config("irc_nickname"),
alt_nicks => [config("irc_nickname2")],

View File

@ -21,9 +21,12 @@ redis_password: hunter2
irc_ssl: true
irc_server: irc.foo.bar
irc_port: 6697
irc_channel: "#baz"
irc_nickname: shithead-ng
irc_nickname2: shithead
irc_channels:
- "#foo"
- "#bar"
- "#baz"
#
# RNG to use