-
-
Save vladmeh/fde9f29cdc47743d1592112dba486c46 to your computer and use it in GitHub Desktop.
Revisions
-
zmts revised this gist
Mar 12, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ ``` - Меняем канал на приватный - Для последующих запросов меням chat_id на `result.chat.id` из тестового ответа - В итоге имеем приватный канал для оповещения средстами обычного REST запроса ``` #POST: https://api.telegram.org/bot<token>/sendMessage { -
zmts revised this gist
Mar 2, 2018 . 1 changed file with 40 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,40 @@ # Используем Telegram канал в качестве системы оповещения - Создаем бота через глобального бота телеграма `@BotFather` - Создаем публичный канал через обычный клиент(desktop/mobile) с публичным именем - Добавляем бота в администраторы канала (с правами отправлять сообщения) - Отправляем тестовое сообщение в канал от имени только что созданного бота ``` #POST: https://api.telegram.org/bot<token>/sendMessage { "chat_id": "@mysuperchannel", "text": "hello!!!" } ``` В ответ получам ``` { "ok": true, "result": { "message_id": 10, "chat": { "id": -2222222222222, "title": "mysuperchannel", "username": "mysuperchannel", "type": "channel" }, "date": 1520000117, "text": "hello!!!" } } ``` - Меняем канал на приватный - Для последующих запросов меням chat_id на `result.chat.id` из тестового ответа - В итоге имеем приватный канал для опевещения средстами обычного REST запроса ``` #POST: https://api.telegram.org/bot<token>/sendMessage { "chat_id": "-2222222222222", "text": "hola !!!" } ``` -
zmts created this gist
Mar 2, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ # Используем Telegram канал в качестве системы оповещения