diff --git a/MarkovBot.pl b/MarkovBot.pl index 8a67915..863c803 100644 --- a/MarkovBot.pl +++ b/MarkovBot.pl @@ -57,12 +57,14 @@ sub said { return unless scalar(@line) > 1; my $start = int rand $#line; 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( channel => config("irc_channel"), body => $resp, - ); + ) if $resp; } # Learn diff --git a/config.default.yml b/config.default.yml index e9dbd6f..be889e3 100644 --- a/config.default.yml +++ b/config.default.yml @@ -3,6 +3,8 @@ # command_character: "." insult: "you're a faggot" +insult_chance: 2 # % chance that the bot will use the insult + # can be 0 to disable insults # # Redis Settings