aboutsummaryrefslogtreecommitdiff
path: root/Plugin
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2018-11-16 00:29:14 +1300
committerDavid Phillips <david@yeah.nah.nz>2018-11-16 00:29:14 +1300
commitc071cf47e93d9156ea522893be4e4e88cb7e30f3 (patch)
tree56d760ff3a585aea1f3b7cd4fcf5b3dfbea0276e /Plugin
parentef496bbdb26f6e981c7ab76237725ea6760dd05d (diff)
downloadidalius-c071cf47e93d9156ea522893be4e4e88cb7e30f3.tar.xz
Greet: Add more natural delay
Diffstat (limited to 'Plugin')
-rw-r--r--Plugin/Greet.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Plugin/Greet.pm b/Plugin/Greet.pm
index 9933104..e66c91a 100644
--- a/Plugin/Greet.pm
+++ b/Plugin/Greet.pm
@@ -56,12 +56,13 @@ my @own_responses = (
sub on_join {
my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_;
my $nick = (split /!/, $who)[0];
+ my $response;
if ($nick eq $root_config->{current_nick}) {
return unless self_odds();
- return some @own_responses;
+ $response = some @own_responses;
} else {
return unless other_odds();
- return some(
+ $response = some(
"hi $nick",
"oh look, $nick is here",
"look who came crawling back",
@@ -71,5 +72,7 @@ sub on_join {
"Welcome to $where->[0], $nick. Leave your sanity at the door",
"I feel sick");
}
+ $irc->delay([privmsg => $where => $response], 1+rand(5));
+ return;
}
1;