# Type: Input and output # Category: Common # Description: Says "Hi" # Dialog: -> OtherQuestions -> MainProject -> MainIssue -> MainActivity # Timeout: 10 sec # Author: Andriy Lesyuk use Orangutan::User; new Orangutan::Context( request => [ 'Hi', 'Hello' ], response => '^H(?:i|ello)[^a-z]*!*\.*$', handler => sub { my ($context, $user, $item) = @_; my $greeted = $user->GetField('greeted'); if (!defined($greeted)) { $user->SetField('greeted', 1); } elsif ($greeted == 1) { $user->SetField('greeted', 2); } return undef; }, ontimeout => sub { my ($context, $user) = @_; $user->SetField('greeted', 2); return undef; }, timeout => 10, weight => sub { my ($context, $user) = @_; if ($user->IsSet(USER_UNCONFIGURED)) { return ( 0, -10, undef ); } else { return ( undef, undef, undef ); } } ); # kate: syntax perl