Start using the new Sender and Chat Getter interface

This commit is contained in:
Lonami Exo
2022-02-12 11:30:29 +01:00
parent f0654a0833
commit c914a92dcf
6 changed files with 8 additions and 31 deletions

View File

@@ -371,7 +371,7 @@ class InteractiveTelegramClient(TelegramClient):
# with events. Since they are methods, you know they may make an API
# call, which can be expensive.
chat = await event.get_chat()
if event.is_group:
if chat.is_group:
if event.out:
sprint('>> sent "{}" to chat {}'.format(
event.text, get_display_name(chat)

View File

@@ -78,7 +78,7 @@ async def handler(event):
# and we said "save pic" in the message
if event.out and event.is_reply and 'save pic' in event.raw_text:
reply_msg = await event.get_reply_message()
replied_to_user = await reply_msg.get_input_sender()
replied_to_user = reply_msg.sender
message = await event.reply('Downloading your profile photo...')
file = await client.download_profile_photo(replied_to_user)