Telegram Bot - PHP Webhook POST to file -


i've read few questions bot api, can't find solution.

my bot works fine without setting webhook , processing /getupdates. can't working setting "https://www.domain.com/page.php" webhook.

i've got shared hosting behind cloudflare's flexible ssl cert , browsers doesn't warn it, assume it's working fine.

i'm trying telegram's post file have clue if webhook need diferent parsing, empty , can't see ssl_acces.log, can't watch if telegram reach page...

here snippet:

$message = json_decode(file_get_contents('php://input'), true); file_put_contents('telegram.txt', var_dump($message)); 

what doing wrong? thanks.

[solution]

the way log is:

$debug = file_get_contents('php://input'); $fp = fopen('debug.txt', 'w'); fwrite($fp, $debug); fclose($fp); 

and solution webhook must set without wwww: /setwebhook?url=https://domain.com/page.php

i had similar issue, , fixed removing line

 (rewritecond %{http_user_agent} ^$ [or])  

from .htaccess file


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -