- Open https://telegram.me/botfather and create bot
- Get messages from your bot: https://api.telegram.org/bot<Bot_token>/getUpdates
- Get chat id from response result.$.message.chat.id
- Send message to bot: https://api.telegram.org/bot<Bot_token>/sendMessage?chat_id=<chat_id>&text=hello
Message with buttons:
https://api.telegram.org/bot<Bot_token>/sendMessage?chat_id=-<chat_id>&text=hello&reply_markup={"inline_keyboard":[[{"text":"button","url":"https://pravyysektor.info"}]]}
https://api.telegram.org/<Bot_token>/getMe
Ідемо в веб-версію і переходимо в групу. Отримуємо урл https://web.telegram.org/#/im?p=g{chat_id}.
Chat_id = -{chat_id}
Ідемо в веб-версію і переходимо в групу. Отримуємо урл https://web.telegram.org/#/im?p=c{chat_id}_1111111111111.
Chat_id = -100{chat_id}
- Стартуємо чат з ботом, пишемо йому повідомлення.
- Отримуємо повідомлення https://api.telegram.org/bot<Bot_token>/getUpdates
- Шукаємо в відповіді сервера повідомлення, яке ми надіслали, і звідтри отримуємо char_id = result.$.message.chat.id
- Add bot to chat as administrator