Bump ver in Teapot::Bot 0.021 -> 0.022 and clenup modules

- Remove Encode module from cpanfile and telegrambot.pm
+ Add Mojo::IOLoop, Mojo::UserAgent, IO::Socket::SSL
* Sort cpanfile
* Bump version Teapot::Bot 0.021 -> 0.022
* Add aleesa-telegram-bot.pid to .gitignore
This commit is contained in:
eleksir
2020-11-07 17:49:24 +03:00
parent 97eddd414d
commit 57120eb461
36 changed files with 79 additions and 74 deletions

1
.gitignore vendored
View File

@@ -3,4 +3,5 @@ data/config.json
data/cache
data/telegrambot-brains
data/lat
aleesa-telegram-bot.pid
TODO

View File

@@ -1,17 +1,22 @@
requires 'Carp';
requires 'Log::Any';
requires 'List::Util';
requires 'Cwd::utf8';
requires 'DB_File';
requires 'Digest::MD5';
requires 'Encode';
requires 'Data::Dumper';
requires 'File::Basename';
requires 'File::Path';
requires 'HTTP::Tiny';
requires 'Hailo';
requires 'HTTP::Tiny';
requires 'IO::Socket::SSL';
requires 'JSON';
requires 'JSON::XS';
requires 'JSON::PP';
requires 'Mojo::Base';
requires 'URI::URL';
requires 'JSON::XS';
requires 'List::Util';
requires 'local::lib';
requires 'Log::Any';
requires 'Mojo::Base';
requires 'Mojo::IOLoop';
requires 'Mojo::UserAgent';
#requires 'Telegram::Bot';
#requires 'Test::Exception';
requires 'URI::URL';

View File

@@ -2,7 +2,7 @@ package Teapot::Bot;
use strict;
use warnings;
$Teapot::Bot::VERSION = '0.021';
$Teapot::Bot::VERSION = '0.022';
# ABSTRACT: A base class to make your very own Telegram bot
1;
@@ -23,7 +23,7 @@ A base class to make your very own Telegram bot
=head1 VERSION
version 0.021
version 0.022
=head1 SYNOPSIS

View File

@@ -18,7 +18,7 @@ use Data::Dumper;
use Teapot::Bot::Object::Message;
$Teapot::Bot::Brain::VERSION = '0.021';
$Teapot::Bot::Brain::VERSION = '0.022';
# base class for building telegram robots with Mojolicious
has longpoll_time => 60;
@@ -399,7 +399,7 @@ Teapot::Bot::Brain - A base class to make your very own Telegram bot
=head1 VERSION
version 0.021
version 0.022
=head1 SYNOPSIS

View File

@@ -5,7 +5,7 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::PhotoSize;
use Carp qw/croak/;
$Teapot::Bot::Object::Animation::VERSION = '0.021';
$Teapot::Bot::Object::Animation::VERSION = '0.022';
has 'file_id';
has 'width';
@@ -37,7 +37,7 @@ Teapot::Bot::Object::Animation - The base class for Telegram message 'Animation'
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'Animation' type.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::Audio;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::Audio::VERSION = '0.021';
$Teapot::Bot::Object::Audio::VERSION = '0.022';
has 'file_id';
has 'duration';
@@ -33,7 +33,7 @@ Teapot::Bot::Object::Audio - The base class for Telegram 'Audio' type objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Audio' type objects.

View File

@@ -5,7 +5,7 @@ use Mojo::Base -base;
use List::Util qw/any/;
use Carp qw/croak/;
$Teapot::Bot::Object::Base::VERSION = '0.021';
$Teapot::Bot::Object::Base::VERSION = '0.022';
has '_brain'; # a reference to our brain
@@ -135,7 +135,7 @@ Teapot::Bot::Object::Base - The base class for all Telegram::Bot::Object objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION

View File

@@ -2,7 +2,7 @@ package Teapot::Bot::Object::CallbackGame;
# ABSTRACT: The base class for Telegram message 'CallbackGame' type.
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::CallbackGame::VERSION = '0.021';
$Teapot::Bot::Object::CallbackGame::VERSION = '0.022';
# https://core.telegram.org/bots/api#callbackgame
# "A placeholder, currently holds no information. Use BotFather to set up your game"
@@ -25,7 +25,7 @@ Teapot::Bot::Object::CallbackGame - The base class for Telegram message 'Callbac
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'CallbackGame' type.

View File

@@ -6,7 +6,7 @@ use Teapot::Bot::Object::ChatPhoto;
use Teapot::Bot::Object::Message;
use Teapot::Bot::Object::ChatPermissions;
$Teapot::Bot::Object::Chat::VERSION = '0.021';
$Teapot::Bot::Object::Chat::VERSION = '0.022';
has 'id';
has 'type';
@@ -59,7 +59,7 @@ Teapot::Bot::Object::Chat - The base class for Telegram 'Chat' type objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Chat' type objects.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::ChatMember;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::User;
$Teapot::Bot::Object::ChatMember::VERSION = '0.021';
$Teapot::Bot::Object::ChatMember::VERSION = '0.022';
has 'user';
has 'status';
@@ -50,7 +50,7 @@ Teapot::Bot::Object::ChatMember - The base class for Telegram 'ChatMember' type
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'ChatMember' type objects.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::ChatPermissions;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::ChatPermissions::VERSION = '0.021';
$Teapot::Bot::Object::ChatPermissions::VERSION = '0.022';
# all fields are optional
# N.B. Some of the fields "overlaps" other, so in order to guess valid set of permissions you should check all of them
@@ -42,7 +42,7 @@ Teapot::Bot::Object::ChatPermissions - The base class for Telegram 'ChatPermissi
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'ChatPermissions' type objects.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::ChatPhoto;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::ChatPhoto::VERSION = '0.021';
$Teapot::Bot::Object::ChatPhoto::VERSION = '0.022';
has 'small_file_id';
has 'big_file_id';
@@ -28,7 +28,7 @@ Teapot::Bot::Object::ChatPhoto - The base class for Telegram 'ChatPhoto' type ob
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'ChatPhoto' type objects.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::Contact;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::Contact::VERSION = '0.021';
$Teapot::Bot::Object::Contact::VERSION = '0.022';
has 'phone_number';
has 'first_name';
@@ -30,7 +30,7 @@ Teapot::Bot::Object::Contact - The base class for Telegram 'Contact' objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Contact' objects.

View File

@@ -5,7 +5,7 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::PhotoSize;
$Teapot::Bot::Object::Document::VERSION = '0.021';
$Teapot::Bot::Object::Document::VERSION = '0.022';
has 'file_id';
has 'thumb'; #PhotoSize
@@ -34,7 +34,7 @@ Teapot::Bot::Object::Document - The base class for Telegram 'Document' objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Document' objects.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::EncryptedCredentials;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::EncryptedCredentials::VERSION = '0.021';
$Teapot::Bot::Object::EncryptedCredentials::VERSION = '0.022';
has 'data';
has 'hash';
@@ -27,7 +27,7 @@ Teapot::Bot::Object::EncryptedCredentials - The base class for Telegram 'Encrypt
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'EncryptedCredentials' type objects.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::EncryptedPassportElement;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::EncryptedPassportElement::VERSION = '0.021';
$Teapot::Bot::Object::EncryptedPassportElement::VERSION = '0.022';
# XXX Implement rest of this
# https://core.telegram.org/bots/api#encryptedpassportelement
@@ -33,7 +33,7 @@ Teapot::Bot::Object::EncryptedPassportElement - The base class for Telegram 'Enc
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'EncryptedPassportElement' type objects.

View File

@@ -7,7 +7,7 @@ use Teapot::Bot::Object::PhotoSize;
use Teapot::Bot::Object::Animation;
use Teapot::Bot::Object::MessageEntity;
$Teapot::Bot::Object::Game::VERSION = '0.021';
$Teapot::Bot::Object::Game::VERSION = '0.022';
has 'title';
has 'description';
@@ -41,7 +41,7 @@ Teapot::Bot::Object::Game - The base class for Telegram message 'Game' type
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'Game' type.

View File

@@ -5,7 +5,7 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::LoginUrl;
use Teapot::Bot::Object::CallbackGame;
$Teapot::Bot::Object::InlineKeyboardButton::VERSION = '0.021';
$Teapot::Bot::Object::InlineKeyboardButton::VERSION = '0.022';
has 'text';
has 'url';
@@ -39,7 +39,7 @@ Teapot::Bot::Object::InlineKeyboardButton - The base class for Telegram 'InlineK
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'InlineKeyboardButton' type objects.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::InlineKeyboardMarkup;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::InlineKeyboardButton;
$Teapot::Bot::Object::InlineKeyboardMarkup::VERSION = '0.021';
$Teapot::Bot::Object::InlineKeyboardMarkup::VERSION = '0.022';
has 'inline_keyboard';
@@ -30,7 +30,7 @@ Teapot::Bot::Object::InlineKeyboardMarkup - The base class for Telegram 'InlineK
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'InlineKeyboardMarkup' type objects.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::Invoice;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::Invoice::VERSION = '0.021';
$Teapot::Bot::Object::Invoice::VERSION = '0.022';
has 'title';
has 'description';
@@ -29,7 +29,7 @@ Teapot::Bot::Object::Invoice - The base class for Telegram 'Invoice' type object
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Invoice' type objects.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::Location;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::Location::VERSION = '0.021';
$Teapot::Bot::Object::Location::VERSION = '0.022';
has 'longitude';
has 'latitude';
@@ -26,7 +26,7 @@ Teapot::Bot::Object::Location - The base class for Telegram message 'Location' t
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'Location' type.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::LoginUrl;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::LoginUrl::VERSION = '0.021';
$Teapot::Bot::Object::LoginUrl::VERSION = '0.022';
has 'url';
has 'forward_text';
@@ -28,7 +28,7 @@ Teapot::Bot::Object::LoginUrl - The base class for Telegram 'LoginUrl' type obje
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'LoginUrl' type objects.

View File

@@ -30,7 +30,7 @@ use Teapot::Bot::Object::InlineKeyboardMarkup;
use Data::Dumper;
$Teapot::Bot::Object::Message::VERSION = '0.021';
$Teapot::Bot::Object::Message::VERSION = '0.022';
# basic message stuff
has 'message_id';
@@ -156,7 +156,7 @@ Teapot::Bot::Object::Message - The base class for the Telegram type "Message"
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for the Telegram type "Message".

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::MessageEntity;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::User;
$Teapot::Bot::Object::MessageEntity::VERSION = '0.021';
$Teapot::Bot::Object::MessageEntity::VERSION = '0.022';
has 'type';
has 'offset';
@@ -34,7 +34,7 @@ Teapot::Bot::Object::MessageEntity - The base class for Telegram 'MessageEntity'
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'MessageEntity' type objects.

View File

@@ -5,7 +5,7 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::EncryptedPassportElement;
use Teapot::Bot::Object::EncryptedCredentials;
$Teapot::Bot::Object::PassportData::VERSION = '0.021';
$Teapot::Bot::Object::PassportData::VERSION = '0.022';
has 'data'; # Array of EncryptedPassportElement
has 'credentials'; # EncryptedCredentials
@@ -35,7 +35,7 @@ Teapot::Bot::Object::PassportData - The base class for Telegram 'PassportData' t
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'PassportData' type objects.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::PhotoSize;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Carp qw/croak/;
$Teapot::Bot::Object::PhotoSize::VERSION = '0.021';
$Teapot::Bot::Object::PhotoSize::VERSION = '0.022';
has 'file_id';
has 'width';
@@ -29,7 +29,7 @@ Teapot::Bot::Object::PhotoSize - The base class for Telegram message 'PhotoSize'
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'PhotoSize' type.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::Poll;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::PollOption;
$Teapot::Bot::Object::Poll::VERSION = '0.021';
$Teapot::Bot::Object::Poll::VERSION = '0.022';
has 'id';
has 'question';
@@ -36,7 +36,7 @@ Teapot::Bot::Object::Poll - The base class for Telegram 'Poll' type objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Poll' type objects

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::PollOption;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::PollOption::VERSION = '0.021';
$Teapot::Bot::Object::PollOption::VERSION = '0.022';
has 'text';
has 'voter_count';
@@ -26,7 +26,7 @@ Teapot::Bot::Object::PollOption - The base class for Telegram 'PollOption' type
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'PollOption' type objects.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::Sticker;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::PhotoSize;
$Teapot::Bot::Object::Sticker::VERSION = '0.021';
$Teapot::Bot::Object::Sticker::VERSION = '0.022';
has 'file_id';
has 'width';
@@ -36,7 +36,7 @@ Teapot::Bot::Object::Sticker - The base class for Telegram message 'Sticker' typ
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'Sticker' type.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::SuccessfulPayment;
use Mojo::Base 'Teapot::Bot::Object::Base';
# use Teapot::Bot::Object::OrderInfo;
$Teapot::Bot::Object::SuccessfulPayment::VERSION = '0.021';
$Teapot::Bot::Object::SuccessfulPayment::VERSION = '0.022';
has 'currency';
has 'total_amount';
@@ -36,7 +36,7 @@ Teapot::Bot::Object::SuccessfulPayment - The base class for Telegram 'Successful
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'SuccessfulPayment' type objects.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::User;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::User::VERSION = '0.021';
$Teapot::Bot::Object::User::VERSION = '0.022';
has 'id';
has 'is_bot';
@@ -37,7 +37,7 @@ Teapot::Bot::Object::User - The base class for Telegram message 'User' type
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'User' type.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::Venue;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::Location;
$Teapot::Bot::Object::Venue::VERSION = '0.021';
$Teapot::Bot::Object::Venue::VERSION = '0.022';
has 'location'; #Location
has 'title';
@@ -34,7 +34,7 @@ Teapot::Bot::Object::Venue - The base class for Telegram 'LoginUrl' type objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'LoginUrl' type objects.

View File

@@ -4,7 +4,7 @@ package Teapot::Bot::Object::Video;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::PhotoSize;
$Teapot::Bot::Object::Video::VERSION = '0.021';
$Teapot::Bot::Object::Video::VERSION = '0.022';
has 'file_id';
has 'width';
@@ -35,7 +35,7 @@ Teapot::Bot::Object::Video - The base class for Telegram 'Video' object
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Video' object.

View File

@@ -5,7 +5,7 @@ package Teapot::Bot::Object::VideoNote;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::PhotoSize;
$Teapot::Bot::Object::VideoNote::VERSION = '0.021';
$Teapot::Bot::Object::VideoNote::VERSION = '0.022';
has 'file_id';
has 'length';
@@ -35,7 +35,7 @@ Teapot::Bot::Object::VideoNote - The base class for Telegram 'VideoNote' type ob
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'VideoNote' type object.

View File

@@ -3,7 +3,7 @@ package Teapot::Bot::Object::Voice;
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::Voice::VERSION = '0.021';
$Teapot::Bot::Object::Voice::VERSION = '0.022';
has 'file_id';
has 'duration';
@@ -28,7 +28,7 @@ Teapot::Bot::Object::Voice - The base class for Telegram 'Voice' type objects
=head1 VERSION
version 0.021
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'Voice' type objects.

View File

@@ -10,7 +10,6 @@ use Data::Dumper;
use open qw(:std :utf8);
use File::Path qw( mkpath );
use Hailo;
use Encode;
use Mojo::Base 'Teapot::Bot::Brain';
use conf qw(loadConf);