Инструкция по шагам.
- Открываем Телеграм и ищем контакт @BotFather, и открываем с ним чат и нажимаем внизу Начать.
- Пишем боту /newbot , он ответит «Alright, a new bot. How are we going to call it? Please choose a name for your bot.» — он говорит, что бот создан и спрашивает, как его назвать — пишем ему имя нашего будущего бота, конечно же на английском, например: mylitlebot
- Бот напишет вам «Good. Now let’s choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot.» — просит указать username нашего бота. напишем ему имя, причем в конце обязательно должны быть символы bot, например myseperlitle_bot (ошибка сделана намерено, потому что @mysuperlitle_bot уже был кем то зарегистрирован на момент написания данной статьи)
- Бот ответит вам следующим текстом
Done! Congratulations on your new bot. You will find it at t.me/myseperlitle_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you’ve finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.Use this token to access the HTTP API:
505718974:AAHYpDfIaIJNRWY1KDiMrDagP-YqsUQE6ts For a description of the Bot API, see this page:
https://core.telegram.org/bots/api505718974:AAHYpDfIaIJNRWY1KDiMrDagP-YqsUQE6ts — это и есть ваш токен нового бота.
Теперь можно создать чат с ботом и получить его chat_id - Ищем чат по userame указанном нами в п.3 @myseperlitle_bot или перейдем по ссылке, которую нам прислал бот в последнем сообщении http://t.me/myseperlitle_bot, словом открываем чат с ботом и пишем ему что-нибудь. Далее берем наш токен вставляем его в следующую строку вместо строки {token}
https://api.telegram.org/bot{token}/getUpdates
в моем случае это был такой url: https://api.telegram.org/bot505718974:AAHYpDfIaIJNRWY1KDiMrDagP-YqsUQE6ts/getUpdates
отправляем запрос через браузер и получаем ответ:{"ok":true,"result":[{"update_id":485763969, "message":{"message_id":1,"from":{"id":376718569,"is_bot":false,"first_name":"\u041f\u043e\u043a\u0430\u043b\u044c\u043d\u0435\u0442\u043e\u0432","last_name":"\u041f\u0430\u0432\u0435\u043b","username":"RedXes","language_code":"en"},"chat":{"id":376718569,"first_name":"\u041f\u043e\u043a\u0430\u043b\u044c\u043d\u0435\u0442\u043e\u0432","last_name":"\u041f\u0430\u0432\u0435\u043b","username":"RedXes","type":"private"},"date":1513335210,"text":"/start","entities":[{"offset":0,"length":6,"type":"bot_command"}]}}]}
среди всего этого видим строку «chat»:{«id»:376718569, 376718569 — это и есть наш chat_id
В итоге мы получили:
token = 505718974:AAHYpDfIaIJNRWY1KDiMrDagP-YqsUQE6ts
chat_id = 376718569
Pingback: canada rx
Pingback: pinshape.comusers2612491-medicine-online-order
Pingback: climbingcoaches.co.ukmember-homecanadianpharmaciesprofile
Pingback: https://www.mixcloud.com/canadapharmacies/
Pingback: www.viki.comuserscanadianpharmaciessabout
Pingback: canadian government approved pharmacies
Pingback: northwest pharmacy canada
Pingback: online canadian pharmacies
Pingback: https://www.beastsofwar.com/forums/users/canadiancialis/
Pingback: www.nzrelo.comforumsuserscanadianviagragenericpharmacy
Pingback: https://bitcoinblack.net/community/prescription-drugs-from-canada/info/
Pingback: offcourse.cousersprofilepharmacy-cheap-no-prescription
Pingback: canadian online pharmacies
Pingback: www.celtras.uniport.edu.ngprofilecanadianpharmacy
Pingback: online pharmacies
Pingback: www.cakeresume.commeonline-drugs-without-prescriptions-canada
Pingback: https://www.passivehousecanada.com/members/online-drugs-without-prescriptions-canada/
Pingback: canadian pharmaceuticals
Pingback: canadian pharmacy no prescription
Pingback: https://forum.melanoma.org/user/canadianpharmacyonline/profile/
Pingback: canadian medications
Pingback: http://climbingcoaches.co.uk/member-home/londondrugscanada/profile/
Pingback: canada drugs
Pingback: https://jemi.so/generic-viagra-online-pharmacy
Pingback: https://www.passivehousecanada.com/members/canada-pharmaceuticals-online-generic/