A
A
Anton Kokarev2016-01-31 18:41:12
PHP
Anton Kokarev, 2016-01-31 18:41:12

How to start Telegram bot HelloBot?

My steps:
1. Installed the LetsEncrypt domain certificate;
2. Got a token from @FatherBot;
3. Downloaded the bot from the Telegram API example (the simplest HellowBot);
4. Installed webhook (launching the bot from the php console);
5. I wrote to the bot in a personal /start.
Result:
It was expected that the bot would answer at least something, but the result is empty: no messages in response, no calls to the bot (empty in the logs).
The question is: What am I doing wrong? Maybe there are some implicit restrictions on the domain\certificate\hosting?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Kokarev, 2016-01-31
@pepsi-man

Hooray! Issue resolved!
The problem was the incorrect installation of the certificate.
The article habrahabr.ru/post/270273 and the online service https://www.ssllabs.com/ssltest/index.html helped. .2 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA:!RC4 SSLCertificateFile /etc/letsencrypt/live/mydomain.tk/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.tk/privkey. pem SSLCertificateChainFile /etc/letsencrypt/live/mydomain.tk/chain.pem SSLCACertificateFile /etc/letsencrypt/live/mydomain.tk/fullchain.pem Then ssllabs.com showed an A- rating and the bot immediately started working!
It is a pity that Telegram does not report this error in any way, and I did not find it in the manual. Although they could report problems to the owner through their @FatherBot bot...

D
Dmitry Entelis, 2016-01-31
@DmitriyEntelis

I do not know what kind of example you downloaded and from where, it works as follows.
1) webhook: when someone writes something to the bot, a request comes to the url specified via FatherBot, the body of which contains user ids and their messages
2) after that, your script should send content to the user using the standard http api.
The problem, respectively, can only be in 2 places, debug)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question