Skip to content

Commit

Permalink
fix: event.file in link
Browse files Browse the repository at this point in the history
  • Loading branch information
hlf20010508 committed Dec 29, 2023
1 parent d276195 commit 9b31907
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/handlers/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ async def transfer_handler(event):
if message:
try:
if "document" in message.media.to_dict():
name = event.file.name
name = message.file.name
status_message = await Status_Message.create(event)
callback = Callback(event, status_message)
response_dict = await multi_parts_uploader(tg_client, message.media.document, name, progress_callback=callback)
await status_message.finish(
path=os.path.join(last_remote_root_path, response_dict['name']),
size=event.file.size
size=message.file.size
)
elif "photo" in message.media.to_dict():
name = "%d%s" % (message.media.photo.id, message.file.ext)
Expand All @@ -88,7 +88,7 @@ async def transfer_handler(event):
onedrive.stream_upload(buffer, name)
await status_message.finish(
path=os.path.join(last_remote_root_path, name),
size=event.file.size
size=message.file.size
)
except Exception as e:
await event.reply('Error: %s' % logger(e))
Expand Down

0 comments on commit 9b31907

Please sign in to comment.