How do I download a file or photo that was sent to my Telegram bot?

This is now available! https://core.telegram.org/bots/api#getfile Hooray! It was added on Sep 18th (2015): https://core.telegram.org/bots/api Usage: In the JSON of the message you will receive a file_id as before. An example of a message object with a voice file: { message_id: 2675, from: { id: 10000001, first_name: ‘john’, username: ‘john’ }, chat: { id: 10000001, first_name: … Read more

How to obtain the chat_id of a private Telegram channel

I found the way to write in private channels. You should convert it to public with some @channelName Send a message to this channel through the Bot API: https://api.telegram.org/bot111:222/sendMessage?chat_id=@channelName&text=123 As the response, you will get information with chat_id of your channel. { “ok” : true, “result” : { “chat” : { **”id” : -1001005582487,** “title” … Read more

Telegram Bot – how to get a group chat id?

In order to get the group chat id, do as follows: Add the Telegram BOT to the group. Get the list of updates for your BOT: https://api.telegram.org/bot<YourBOTToken>/getUpdates Ex: https://api.telegram.org/bot123456789:jbd78sadvbdy63d37gda37bd8/getUpdates Look for the “chat” object: {“update_id”:8393,”message”:{“message_id”:3,”from”:{“id”:7474,”first_name”:”AAA”},”chat”:{“id”:<group_ID>,”title”:””},”date”:25497,”new_chat_participant”:{“id”:71,”first_name”:”NAME”,”username”:”YOUR_BOT_NAME”}}} This is a sample of the response when you add your BOT into a group. Use the “id” of the … Read more