# Allow POST requests from Telegram
<IfModule mod_rewrite.c>
    RewriteEngine On

    # Ensure POST requests reach bot.php
    RewriteCond %{REQUEST_METHOD} ^POST$
    RewriteRule ^bot\.php$ - [L]

    # Block direct access to other files
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ - [F,L]
</IfModule>

# Allow Telegram IPs (optional whitelist)
# <RequireAll>
#     Require ip 149.154.160.0/20
#     Require ip 91.108.4.0/22
# </RequireAll>
