[英]Why my Telegram bot doesn't work in the terminal on my computer?
[英]Ruby - How download to my computer the photo sent by the user to the telegram bot?
我正在為我的電報機器人使用 Ruby。 人們向機器人發送一些信息,有時是照片。 我需要將這張照片保存到我的計算機中 Ruby 文件的目錄中,然后如果需要,將這張照片發送給其他人。
那么,如何下載發送到我的 Telegram 機器人的照片? 我從 Telegram 的官方網站了解 getFile 以及這個問題如何下載發送到我的 Telegram 機器人的文件或照片? 但我不明白如何將它與 Ruby 一起使用,因為我在 5 個月前才開始使用 ruby。 我嘗試編寫不同的代碼,但都不起作用......
bot.messages_handler(content_types=['photo'])
bot.send_message(message.chat_id,bot.get_file_url(message.photo[0].file_id))
我希望能得到你的幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.