Use ->canTalk() instead of ::canTalk() in Message.pm as it is more reliable way to check this
This commit is contained in:
@@ -157,7 +157,7 @@ sub reply {
|
|||||||
|
|
||||||
my $chatid = $self->chat->id;
|
my $chatid = $self->chat->id;
|
||||||
|
|
||||||
if (Teapot::Bot::Object::ChatPermissions::canTalk($self, $chatid)) {
|
if (Teapot::Bot::Object::ChatPermissions->canTalk($self, $chatid)) {
|
||||||
return $self->_brain->sendMessage({chat_id => $chatid, text => $text});
|
return $self->_brain->sendMessage({chat_id => $chatid, text => $text});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ sub replyMd {
|
|||||||
|
|
||||||
my $chatid = $self->chat->id;
|
my $chatid = $self->chat->id;
|
||||||
|
|
||||||
if (Teapot::Bot::Object::ChatPermissions::canTalk ($self, $chatid)) {
|
if (Teapot::Bot::Object::ChatPermissions->canTalk ($self, $chatid)) {
|
||||||
my $send_args;
|
my $send_args;
|
||||||
$send_args->{text} = $text;
|
$send_args->{text} = $text;
|
||||||
$send_args->{parse_mode} = 'Markdown';
|
$send_args->{parse_mode} = 'Markdown';
|
||||||
@@ -187,7 +187,7 @@ sub typing {
|
|||||||
|
|
||||||
my $chatid = $self->chat->id;
|
my $chatid = $self->chat->id;
|
||||||
|
|
||||||
if (Teapot::Bot::Object::ChatPermissions::canTalk ($self, $chatid)) {
|
if (Teapot::Bot::Object::ChatPermissions->canTalk ($self, $chatid)) {
|
||||||
return $self->_brain->sendChatAction({chat_id => $chatid});
|
return $self->_brain->sendChatAction({chat_id => $chatid});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user