Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
电报机器人-无法从光盘发送照片(bash脚本)_Bash_Telegram_Telegram Bot - Fatal编程技术网

电报机器人-无法从光盘发送照片(bash脚本)

电报机器人-无法从光盘发送照片(bash脚本),bash,telegram,telegram-bot,Bash,Telegram,Telegram Bot,我知道如何从用户那里获取照片 filepath=$(curl https://api.telegram.org/botXXXXX/getFile?file_id=$fileid | jq '.result.file_path' | sed 's/\"//g') wget https://api.telegram.org/file/botXXXXX/$filepath -P files/ 我修改了这张照片,想把它寄回去,但我一点也不明白这张照片是怎么回事 谢谢您的帮助。如果您想从硬盘发送照片

我知道如何从用户那里获取照片

filepath=$(curl https://api.telegram.org/botXXXXX/getFile?file_id=$fileid | jq '.result.file_path' | sed 's/\"//g')

wget  https://api.telegram.org/file/botXXXXX/$filepath -P files/
我修改了这张照片,想把它寄回去,但我一点也不明白这张照片是怎么回事


谢谢您的帮助。

如果您想从硬盘发送照片,可以使用
curl

curl -F "chat_id=<RECIPIENT_CHAT_ID>" -F "photo=@/home/ivan/t_logo.png" \
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendphoto
curl-F“chat_id=“-F”photo=@/home/ivan/t_logo.png”\
https://api.telegram.org/bot/sendphoto