L
L
Lulzsec2015-08-23 18:52:12
MySQL
Lulzsec, 2015-08-23 18:52:12

Telegram Webhook does not send requests to an address with HTTPS (code attached), what's the problem?

1. Made the bot right
2. Linked the Webhook correctly to the address on a free hosting, but with SSL: https://DOMAINNAME.c9.io/Apimaster/1.php
3. Code 1.php:

$datas = json_decode(file_get_contents("php://input"),true);

Everything seems to be correct, but it doesn't work.
If you just write without checking the entered text like this:
$bot = new \TelegramBot\Api\BotApi('123**************:****************************');
$messageText3='lalala';
$chatId=НОМЕР;
$bot->sendMessage($chatId, $messageText3);

And open the file in the browser, then the message is sent.
For some reason, the webhook refuses to work.
The certificate is issued by COMODO RSA DOMAIN VALIDATION SECURE SERVER and is valid for all subdomain names.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Moses Fender, 2019-02-28
@mosesfender

Something like this.

SELECT u.* FROM users
LEFT JOIN purchases pur ON pur.user_id = u.id
LEFT JOIN products p ON p.id = pr.product_id
WHERE p.id IN (1,2,3)

D
Dmitry Entelis, 2015-08-23
@DmitriyEntelis

Well, you would save somewhere for yourself what comes in file_get_contents("php://input")with a single message.
There comes a structure

{
"update_id":137806900,
"message":{
  "message_id":553,
  "from":{
    "id":331953,
    "first_name":"Дмитрий",
    "last_name":"Энтелис",
    "username":"dentelis"
  },
  "chat":{
    "id":331953,
    "first_name":"Дмитрий",
    "last_name":"Энтелис",
    "username":"dentelis"
  },
  "date":1439369724,
  "text":"!!!"
  }
}

Accordingly, there are no results there

P
Platon Fedorovich, 2016-03-30
@platon_fedorovich

Try to do, by analogy, with this example: blizzy.ru/telegram/razmesaem-bota-na-platforme-heroku Maybe it's not the certificate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question