These are some useful command for you to use a telegram bot send messages in bash shell.
Send message:
curl -s -X POST https://api.telegram.org/botAPI-KEY/sendMessage -d chat_id=CHAT_ID -d text="YOUR MESSAGE HERE"
Send Photo:
curl -F "chat_id=CHAT_ID" -F "photo=@/path/to/yourimage.png" https://api.telegram.org/botAPI_KEY/sendphoto
Send document files
curl -F document=@"path/to/yourfile" https://api.telegram.org/botAPI-KEY/sendDocument?chat_id=CHAT_ID
How to get CHAT_ID for your telegrambot?
- Add your bot to a group , and grant the send messages to him.
- Chat with your bot, send a welcome message.
- Run the following url to get chat_id
https://api.telegram.org/botAPI_KEY/getUpdates
An additional tip for you: Change your bot avatar? Just chat with botfather, and select your botname, send a photo as his avatar. That’s done.