Use message.sender_chat as well

This commit is contained in:
blank X 2021-05-30 22:32:59 +07:00
parent b904b1b641
commit 2679989bb9
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 3 additions and 2 deletions

View File

@ -54,13 +54,14 @@ DEAI_MODULE_CODES = {
@log_errors
@public_log_errors
async def fedstat(client, message):
entity = message.from_user
entity = message.from_user or entity.sender_chat
args = message.command
command = args.pop(0).lower()
if args:
entity = ' '.join(args)
elif not getattr(message.reply_to_message, 'empty', True):
entity = message.reply_to_message.from_user or entity
reply = message.reply_to_message
entity = reply.from_user or reply.sender_chat or entity
if isinstance(entity, str) and (not entity.isnumeric() and not entity.startswith('TEL-')):
entity, entity_client = await get_entity(client, entity)
if not isinstance(entity, str):