From c071cf47e93d9156ea522893be4e4e88cb7e30f3 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 16 Nov 2018 00:29:14 +1300 Subject: Greet: Add more natural delay --- Plugin/Greet.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Plugin') 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; -- cgit v1.1