# Type: Input # Category: Reusable # Description: Handles numbers # Note: Contains foreign handlers # Author: Andriy Lesyuk new Orangutan::Context( response => '^([0-9]+)[.)]? *!*\.*$', handler => sub { my ($context, $user, $item, $number) = @_; if (!$context->CallForeignHandler($user, -2, $number)) { my $showissue = $user->GetResponse('ShowIssue'); if ($showissue) { $showissue->CallHandler($user, -2, $number); return; } } }, schedule => sub { my ($context, $scheduler, $arg) = @_; if ($arg eq 'clean') { foreach my $username ($main::users->GetUsers) { my $user = $main::users->GetUser($username); my $ucontext = $user->GetResponse($context->GetID); if (defined($ucontext)) { $ucontext->CleanForeignHandlers; } } } my ($hour, $day, $month, $year) = (localtime(time))[2..5]; if ($hour >= 3) { ($day, $month, $year) = (localtime(time + 86400))[3..5]; } my $time = POSIX::mktime(0, 0, 3, $day, $month, $year); $scheduler->Schedule($time, $context, 'clean'); }, weight => [ undef, -50, undef ], copy => 1 ); # kate: syntax perl