First run with admin module: fix typos in ChatMember.pm, Brain.pm, admin.pm, botlib.pm

This commit is contained in:
eleksir
2021-02-23 14:10:54 +03:00
parent e38726a1f2
commit 04cb3d2357
5 changed files with 50 additions and 32 deletions

View File

@@ -276,20 +276,15 @@ sub deleteMessage {
my $token = $self->token || croak 'No token supplied to deleteMessage()?';
if (Teapot::Bot::Object::ChatMember::canDelete($self, $chatid)) {
if (Teapot::Bot::Object::ChatMember::canDeleteMessage($self, $args->{chat_id})) {
my $url = "https://api.telegram.org/bot${token}/deleteMessage";
my $api_response = $self->_post_request($url, $send_args);
if ($api_response) {
return Teapot::Bot::Object::Message->create_from_hash($api_response, $self);
}
else {
return {'error' => 1};
}
$self->_post_request($url, $send_args);
}
else {
return {'error' => 1};
}
return;
}