question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to upload files? (update to Telethon > 1.0)

See original GitHub issue
  • telegram-upload version: 0.1.5
  • Python version: 3.5
  • Operating System: Elementary OS

Description

Describe what you were trying to get done. I was trying to upload file using telegram-upload Tell us what happened, what went wrong, and what you expected to happen. File wasn’t uploaded and I got a warning.

What I Did

I ran the command telegram-upload /home/cyberboy/python/TelegramBot/test100k.db

Paste the command(s) you ran and the output.

/usr/local/lib/python3.5/dist-packages/telegram_upload/client.py:31: RuntimeWarning: coroutine ‘UploadMethods.send_file’ was never awaited progress_callback=progress, attributes=get_file_attributes(file))


If there was a crash, please include the traceback here.

I’m not able to understand how to make it upload a certain file. I also had a query whether it can send the uploaded file to a member having a certain chat_id ?

A documentation of how to use this will be very useful.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Nekmocommented, Jul 22, 2018

There have been changes in the Telethon dependency. https://telethon.readthedocs.io/en/latest/extra/basic/asyncio-magic.html

(telegram-upload) [nekmo@homura ~/Workspace/telegram-upload] (master)$ ./scripts/telegram-upload tox.ini 
/home/nekmo/Workspace/telegram-upload/telegram_upload/client.py:31: RuntimeWarning: coroutine 'UploadMethods.send_file' was never awaited
  progress_callback=progress, attributes=get_file_attributes(file))

(telegram-upload) [nekmo@homura ~/Workspace/telegram-upload] (master)$ 

It is necessary to adapt the code. Meanwhile, you can use an earlier version of Telethon.

pip install Telethon==0.18.1.1

Thanks for your help.

1reaction
Nekmocommented, Jul 21, 2018

By default telegram-upload sends the files to your own user (me). You can specify the user (using @user or id) with the --to parameter.

Help:

(tmp-103922b346dce22) [nekmo@homura ~/.virtualenvs/tmp-103922b346dce22]$ telegram-upload --help
Usage: telegram-upload [OPTIONS] [FILES]...

Options:
  --to TEXT
  --config TEXT
  -d, --delete-on-success
  --help                   Show this message and exit.
Read more comments on GitHub >

github_iconTop Results From Across the Web

FastTelethonhelper - PyPI
Make Telethon files upload/download faster. ... FastTelethonhelper 1.0.7. pip install FastTelethonhelper. Copy PIP instructions. Latest version.
Read more >
Telethon Documentation - Read the Docs
Telethon is a Python library, which means you need to download and install Python from https://www.python.org/.
Read more >
Working with Updates — Telethon 1.7.7 documentation
Coming from Telethon before it reached its version 1.0? ... from telethon import TelegramClient, events client = TelegramClient('name', api_id, ...
Read more >
Changelog (Version History) — Telethon 1.26.0 documentation
This page lists all the available versions of the library, in chronological order. You should read this when upgrading the library to know...
Read more >
Downloads an uploaded file from updates telethon
Do i need to create a new function or it can be inside that my_event_handler function? You can just add a few rows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found