Telegram::BotKit::Wizard - State automat for Telegram Bots
version 0.03
my $wizard = Telegram::BotKit::Wizard->new({ screens_arrayref => [{},{}, ... , {}], dyn_kbs_class=>'Test::Class', serialize_func => \&test_func(), # not implemented now keyboard_type => 'inline' # regular by default, default_welcome_msg => '', # message to show if there is no 'welcome_msg' attr at screen debug => 1 )};
my $msg = $w->process($update); $api->sendMessage($msg); # my $api = WWW::Telegram::BotAPI->new(token => '');
Set defaults for non-obligatory parameters
Get screen depending on was /start cmd sent or previous screen in session
Create an array for keyboard
Works both with static or dynamic screens
Build message depending on $screen, $chat_id and $callback_msg
$self->build_msg($screen, $chat_id, $text)
Correct update of session. Here you can see which parameters of screen to save
Main public subroutine. Process Update object and return msg for sendMessage method
Pavel Serikov <pavelsr@cpan.org>
This software is copyright (c) 2017 by Pavel Serikov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Telegram::BotKit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Telegram::BotKit
CPAN shell
perl -MCPAN -e shell install Telegram::BotKit
For more information on module installation, please visit the detailed CPAN module installation guide.