π¨πΌπ»κ°λ°/νμ΄μ¬
νμ΄μ¬ - ν λ κ·Έλ¨ λ΄ νμΌ μ λ‘λ(λ΄μ΄ νμΌμ λ€μ΄λ‘λ)
Janger
2022. 6. 18. 04:16
728x90
def uploader(update: Update, context: CallbackContext) -> None:
try:
with open(update.message.document.file_name, 'wb') as f:
context.bot.get_file(update.message.document).download(out=f)
update.message.reply_text( 'νμΌ μ
λ‘λ μ±κ³΅.' )
except:
update.message.reply_text( 'νμΌ μ
λ‘λ μ€ν¨.' )
updater.dispatcher.add_handler(MessageHandler(Filters.document, uploader))
μΆμ²:
https://stackoverflow.com/questions/62253718/how-can-i-receive-file-in-python-telegram-bot
How can I receive file in python-telegram-bot?
I have a problem about file messages in python telegram bot. How can I receive file and read that file ? Or save it.
stackoverflow.com
728x90