php-telegram-bot / telegram-bot-manager

PHP Telegram Bot Manager
MIT License
209 stars 66 forks source link

Fatal error: Uncaught validateRequest() #79

Closed tayyabbashir2224 closed 1 year ago

tayyabbashir2224 commented 1 year ago

Support Question

<-- ❗ NEVER put your Telegram API key or any other private details here. (like passwords, user IDs, etc.) Substitute them like or etc. -->

Required Information

? !
Operating system Name and version
PHP Telegram Bot Manager version 2.0.0
PHP Telegram Bot version 0.77.1 as 0.73
PHP version 8.0
MySQL version x.y.z / none
Update Method Webhook
Self-signed certificate no
RAW update (if available) {...}

Summary

when i run https://mydomain.com/manager.php?s=T4yy4B&?a=unset i get this error Fatal error: Uncaught TelegramBot\TelegramBotManager\Exception\InvalidAccessException: Invalid access in /membri/mybbpk/vendor/php-telegram-bot/telegram-bot-manager/src/BotManager.php:476 Stack trace: #0 /membri/mybbpk/vendor/php-telegram-bot/telegram-bot-manager/src/BotManager.php(90): TelegramBot\TelegramBotManager\BotManager->validateRequest() #1 /membri/mybbpk/manager.php(31): TelegramBot\TelegramBotManager\BotManager->run() #2 {main} thrown in /membri/mybbpk/vendor/php-telegram-bot/telegram-bot-manager/src/BotManager.php on line 476

noplanman commented 1 year ago

Hi @tayyabbashir2224, is this resolved for you?

Since you're calling this via the web, you'll need to allow your IP address specifically via the config.

Either declare your IP as trusted (recommended):

'validate_request' => true,
'valid_ips' => [
   '1.2.3.4', // put your IP here
],

Or allow any IP (not recommended):

'validate_request' => false,
tayyabbashir2224 commented 1 year ago

Hi @tayyabbashir2224, is this resolved for you?

Since you're calling this via the web, you'll need to allow your IP address specifically via the config.

Either declare your IP as trusted (recommended):

'validate_request' => true,
'valid_ips' => [
   '1.2.3.4', // put your IP here
],

Or allow any IP (not recommended):

'validate_request' => false,

set to false makes output webhhok set but /start command not works. everyting is already in there (config.php)

tayyabbashir2224 commented 1 year ago

it is now working thanks...