add option for insult probability
This commit is contained in:
parent
cd457755cb
commit
6aac87f8c8
|
@ -57,12 +57,14 @@ sub said {
|
||||||
return unless scalar(@line) > 1;
|
return unless scalar(@line) > 1;
|
||||||
my $start = int rand $#line;
|
my $start = int rand $#line;
|
||||||
my $resp = markov( [$line[$start], $line[$start+1]] );
|
my $resp = markov( [$line[$start], $line[$start+1]] );
|
||||||
$resp = config("insult") unless $resp;
|
if (rand() * 100 < config("insult_chance") && !$resp) {
|
||||||
|
$resp = config("insult");
|
||||||
|
}
|
||||||
|
|
||||||
$self->say(
|
$self->say(
|
||||||
channel => config("irc_channel"),
|
channel => config("irc_channel"),
|
||||||
body => $resp,
|
body => $resp,
|
||||||
);
|
) if $resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Learn
|
# Learn
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#
|
#
|
||||||
command_character: "."
|
command_character: "."
|
||||||
insult: "you're a faggot"
|
insult: "you're a faggot"
|
||||||
|
insult_chance: 2 # % chance that the bot will use the insult
|
||||||
|
# can be 0 to disable insults
|
||||||
|
|
||||||
#
|
#
|
||||||
# Redis Settings
|
# Redis Settings
|
||||||
|
|
Loading…
Reference in New Issue