diff options
author | David Phillips <david@yeah.nah.nz> | 2018-11-16 00:29:14 +1300 |
---|---|---|
committer | David Phillips <david@yeah.nah.nz> | 2018-11-16 00:29:14 +1300 |
commit | c071cf47e93d9156ea522893be4e4e88cb7e30f3 (patch) | |
tree | 56d760ff3a585aea1f3b7cd4fcf5b3dfbea0276e | |
parent | ef496bbdb26f6e981c7ab76237725ea6760dd05d (diff) | |
download | idalius-c071cf47e93d9156ea522893be4e4e88cb7e30f3.tar.xz |
Greet: Add more natural delay
-rw-r--r-- | Plugin/Greet.pm | 7 |
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; |