First run of Teapot::Bot fixes.

* Fix typos in Brain.pm
* Fix typos in User.pm
* Implement typing methods in Message object and make use of it
* Fix incorrect syntax of unless loops in telegrambot.pm
* Add Log::Any as it required by Teapot::Bot
* Do not use --update in bootstrap.sh
* Add data/lat to .gitignore
* Load ChatMember and ChatPermissions in Message object, so we can use 'em and avoid crash
* Supply missing $send_args to _post_request
This commit is contained in:
eleksir
2020-10-30 17:19:40 +03:00
parent 43c0286414
commit a480786afa
7 changed files with 23 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ use warnings;
use Mojo::IOLoop;
use Mojo::UserAgent;
use Carp qw/croak, cluck, confess/; # use croak where we return error up to app that supply something wrong
use Carp qw/croak cluck confess/; # use croak where we return error up to app that supply something wrong
# use cluck where we want to say that something bad but non-critical happen in
# lower layer (Mojo loop)
# use confess where we want to say that fatal error happen in lower layer (Mojo loop)
@@ -111,7 +111,7 @@ sub getChatMember {
my $token = $self->token || croak "no token?";
my $url = "https://api.telegram.org/bot${token}/getChatMember";
my $api_response = $self->_post_request($url);
my $api_response = $self->_post_request($url, $send_args);
if ($api_response) {
return Teapot::Bot::Object::ChatMember->create_from_hash($api_response, $self);
@@ -133,7 +133,7 @@ sub getChat {
my $token = $self->token || croak "no token?";
my $url = "https://api.telegram.org/bot${token}/getChat";
my $api_response = $self->_post_request($url);
my $api_response = $self->_post_request($url, $send_args);
if ($api_response) {
return Teapot::Bot::Object::Chat->create_from_hash($api_response, $self);