fix: posts from channels detected as bots (#1076)

* fix(): posts from channels detected as bots

Possibly fixes #937

* fix(): use getattr instead of hasattr
This commit is contained in:
zyuhel 2023-10-25 12:22:22 +03:00 committed by GitHub
parent cf8de7d7a6
commit 37f0bfbd34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,12 @@ def command_whois(update: Update, context: CallbackContext) -> None:
from_user = original_message.forward_from
if from_user.is_bot:
if getattr(original_message, 'sender_chat', None):
update.message.reply_text(
"Сообщение отправлено от имени чата/канала",
quote=True
)
return
update.message.reply_text(
"Это бот, глупышка",
quote=True