Fix some errors of tg api v5.1 transition

This commit is contained in:
eleksir
2021-04-25 00:40:48 +03:00
parent fbab0a4d88
commit 8e2414288b
2 changed files with 9 additions and 2 deletions

View File

@@ -18,6 +18,13 @@ use Log::Any;
use Data::Dumper;
use Teapot::Bot::Object::Message;
use Teapot::Bot::Object::Poll;
use Teapot::Bot::Object::PollAnswer;
use Teapot::Bot::Object::ChatMemberUpdated;
use Teapot::Bot::Object::User;
use Teapot::Bot::Object::Chat;
use Teapot::Bot::Object::ChatMember;
use Teapot::Bot::Object::ChatInviteLink;
$Teapot::Bot::Brain::VERSION = '0.022';
@@ -354,7 +361,7 @@ sub deleteMessage {
my $token = $self->token || croak 'No token supplied to deleteMessage()?';
if (Teapot::Bot::Object::ChatMember::canDeleteMessage($self, $args->{chat_id})) {
if (Teapot::Bot::Object::ChatMember->canDeleteMessage($self, $args->{chat_id})) {
my $url = "https://api.telegram.org/bot${token}/deleteMessage";
$self->_post_request($url, $send_args);
}

View File

@@ -6,7 +6,7 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::VoiceChatEnded::VERSION = '0.022';
# This object represents a service message about a voice chat started in the chat. Currently holds no information.
has 'duartion';
has 'duration';
sub fields {
return { scalar => [qw/duration/] };