Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (18 sloc) 484 Bytes
#!/usr/bin/env perl
use strict;
use warnings;
use Log::Any::Adapter qw< Stderr >;
use Bot::ChatBots::Telegram::LongPoll;
my $token = shift || $ENV{TOKEN};
my $lp = Bot::ChatBots::Telegram::LongPoll->new(
token => $token,
processor => \&processor,
start => 1,
);
sub processor { # tube-compliant
my $record = shift;
my $text = $record->{payload}{text};
print "$text\n";
$record->{send_response} = "you said: '$text'";
return $record; # follow on..
}