Bot isn't responding, also set.php returns:
Longman\TelegramBot\Exception\TelegramException: Telegram returned an invalid response! Please review your bot name and API key.
API key is correct, double-checked and is fine. Bot stopped working yesterday.
I wrote BotSupport (Telegram) about this, and they answer this:
What exact answer do you get when calling getWebhookInfo? That should give some info.
getWebhookInfo returns:
{"ok":true,"result":{"url":"https://mydomain.com/hook.php","has_custom_certificate":false,"pending_update_count":0,"max_connections":40,"allowed_updates":["message","channel_post","inline_query","chosen_inline_result","callback_query"]}}
It doesn't seems that there are any pending updates. It seems that, at least, you are receiving the updates, do you get any error when you try to answre them?
debug.log:
upload completely sent off: 2512 out of 2512 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.10.0
< Date: Fri, 17 Mar 2017 16:42:23 GMT
< Content-Type: application/json
< Content-Length: 5054
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, POST, OPTIONS
< Access-Control-Expose-Headers: Content-Length,Content-Type,Date,Server,Connection
< Strict-Transport-Security: max-age=31536000; includeSubdomains
<
[] []
[2017-03-17 17:11:30] bot_log.DEBUG: Verbose HTTP Request output:
[] []
[2017-03-17 17:12:26] bot_log.DEBUG: Verbose HTTP Request output:
[] []
[2017-03-17 17:12:30] bot_log.DEBUG: Verbose HTTP Request output:
[] []
[2017-03-17 17:18:10] bot_log.DEBUG: Verbose HTTP Request output:
[] []
[2017-03-17 17:41:32] bot_log.DEBUG: Verbose HTTP Request output:
[] []
[2017-03-17 17:41:50] bot_log.DEBUG: Verbose HTTP Request output:
Could not resolve host: api.telegram.org
Obviously the server can't connect to the API, this is something that isn't library's fault I think.
Tried setting the webhook manually? (creating url with variables)
Suddenly I got that error, will contact my server admin and update this topic
If you have access to hosts file you could try to manually specify the IP there, but I wouldn't recommend it for future use.
root@ubuntu:# ping api.telegram.org
ping: unknown host api.telegram.org
root@ubuntu:# ping google.com
ping: unknown host google.com
Looks like there is some problem with /etc/resolv.conf
I have the same problem. My hook works, but when I run script to send some messages I receive "Telegram returned an invalid response! Please review your bot name and API key." . But API key is common for hook and send message script.
Have you some solution already?
@dzarezenko Could you give us more info of your situation/setup?
Sorry, looks like it was problem with SSL certificate configuration. We can send messages without certificate configured and I have coded sending at first. When I configured certificate for hook, sending stopped work. It was certificate problem.
Thank you for your help!