diff --git a/src/Types/Handler.php b/src/Types/Handler.php index 4deafa7..e44169f 100644 --- a/src/Types/Handler.php +++ b/src/Types/Handler.php @@ -51,7 +51,12 @@ public static function get(): array * @return array * @throws Exception */ - private static function filterUpdate (Request $update) { + private static function filterUpdate (Request $update) + { + + if (IpUtils::checkIp($update->ip(), config('laragram.trusted_ips'))) { + return $update->all(); + } if (App::environment('local') && IpUtils::checkIp($update->ip(), self::$localIpNets)) { return $update->all(); diff --git a/src/config/laragram.php b/src/config/laragram.php index 66c9064..0870456 100644 --- a/src/config/laragram.php +++ b/src/config/laragram.php @@ -2,5 +2,10 @@ return [ 'token' => env('TELEGRAM_BOT_TOKEN'), - 'url' => '/api/bot' -]; \ No newline at end of file + 'url' => '/api/bot', + + // Trusted Telegram IP addresses or proxies + 'trusted_ips' => [ +// '127.0.0.1/32' + ], +];