๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/ํŒŒ์ด์ฌ

ํŒŒ์ด์ฌ - ํ…”๋ ˆ๊ทธ๋žจ ๋ด‡ ํŒŒ์ผ ์—…๋กœ๋“œ(๋ด‡์ด ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œ)

by Janger 2022. 6. 18.
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
๋ฐ˜์‘ํ˜•