Skip to content

Commit

Permalink
fix: posts from channels detected as bots (#1076)
Browse files Browse the repository at this point in the history
* fix(): posts from channels detected as bots

Possibly fixes #937

* fix(): use getattr instead of hasattr
  • Loading branch information
zyuhel authored Oct 25, 2023
1 parent cf8de7d commit 37f0bfb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bot/handlers/whois.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37f0bfb

Please sign in to comment.