Closed AlessandroMarchetto closed 4 years ago
Hi @AlessandroMarchetto!
So sorry to hear that you've spent so much time on this, but well done for reaching out 💪
As long as the secret
is correct, and your IP is really the one added to the valid_ips
array, the request should work.
Could you please try to set validate_request
to false
to make sure that's not the problem?
Also, $bot->setCustomGetUpdatesCallback(...);
must come before $bot->run();
Hi, thank's a lot for your answer. I put validate request as false // (bool) Only allow webhook access from valid Telegram API IPs. 'validate_request' => false, I inserted an echo to check my ip $ip = $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0'; echo 'indirizzo ip : ' . $ip . PHP_EOL;
The ip show is my public ip, i also added my admins id and with /help i can see both admin and user command.
i use my url bott + manager.php?s=1234567890?a=reset
and now is working i can reset, set, unset
i don't know why, now it work also with // (bool) Only allow webhook access from valid Telegram API IPs. 'validate_request' => true,
after unch i will try to move again $bot=... after $bot->run(); $bot->setCustomGetUpdatesCallback(function (ServerResponse $get_updates_response) { $results = array_filter((array) $get_updates_response->getResult()); return sprintf('There are %d update(s)' . PHP_EOL, count($results)); }); $bot->run();
Thank's a lot for you help Bye and thank's Alex
Glad to hear that! So all good then?
About manager, every think is ok. But i'm trying to write 2 bot, one to access coinbase api and get some result, and another to control channel and contents. And i can't find example to use, and poor documentation. But i study and try to solve.
Thank's very much for your help Alex
Support Question
Required Information
{...}
Summary
HI, after many day's of try i dediced to ask for help. I'm trying to create a bot for telegram, i'm using hostinger cloud global service, and i connected via SSH to my linux space (i thing hostinger is linux) My first test was with set.php, unset.php and it work perfectly. But i decided to use manager.php so i can set password (secret) to protect set, unset and reset.
If i try use manager.php from ssh i can do set, unset, reset, webhookinfo without any problem. so the command:
php manager.php a=reset / set / unset / WebHookInfo
The Work without any problem If i try from browser i get always invalid access.https://mybotlink/manager.php?s=123456789?a=set/unset/reset/WebHookInfo
return always invalid accessI spend a lot of time (3 full days) without found a solution. Someone could help me to solve this problem ?
After my name the content of composer.json and manager.php under //Bot Setting and // MySql Setting all parameter are not real, made only for this support help I hope this is enough to discover where is my error. Thank's a lot for help Alex
<- This is content of composer.json: -------------------------------------->
<- This is content of manager.php: -------------------------------------->