Bot::ChatBots::Telegram - Telegram adapter for Bot::ChatBots
This document describes Bot::ChatBots::Telegram version 0.011001.
# A minimal Telegram Bot using WebHooks use Log::Any qw< $log >; use Log::Any::Adapter; use Mojolicious::Lite; Log::Any::Adapter->set(MojoLog => logger => app->log); plugin 'Bot::ChatBots::Telegram' => instances => [ [ 'WebHook', processor => \&processor, register => 1, token => $ENV{TOKEN}, unregister => 1, url => 'https://example.com:8443/mybot', ], # more can follow here... ]; app->start; sub processor { my $record = shift; # do whatever you want with $record, e.g. set a quick response $record->{send_response} = 'your thoughs are important for us!'; return $record; } # You can also add Bot::ChatBots::Telegram::LongPoll sources if you want
This module allows you to to define Bot::ChatBots for Telegram Messenger.
All the heavylifting is done by Bot::ChatBots::MojoPlugin.
Report bugs through GitHub (patches welcome).
Bot::ChatBots, Bot::ChatBots::Telegram::WebHook, Bot::ChatBots::Telegram::LongPoll, WWW::Telegram::BotAPI.
Flavio Poletti <polettix@cpan.org>
Copyright (C) 2016, 2018 by Flavio Poletti <polettix@cpan.org>
This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install Bot::ChatBots::Telegram, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::ChatBots::Telegram
CPAN shell
perl -MCPAN -e shell install Bot::ChatBots::Telegram
For more information on module installation, please visit the detailed CPAN module installation guide.