Skip to content

2. Webhook

Mohammad Zarifiyan edited this page Mar 31, 2024 · 3 revisions

Telegram webhook allows you to receive updates immediately.

Set webhook

If you would like to receive Telegram updates you have to create a route named telegram-update, Then run the following command.

php artisan telegram:set-webhook

You can use your custom route name instead of telegram-update, but you have to update update-route in the telegram.php config file.

Note: Your update route URL must start with https:// and you have to install a valid SSL/TSL certificate on your domain.

Safer approach

To set webhook in a safer approach you have to add following variable to your .env file before running set webhook console command:

TELEGRAM_SECURE_TOKEN=

Note: Only characters A-Z, a-z, 0-9, _ and - are allowed for TELEGRAM_SECURE_TOKEN environment variable.

Clone this wiki locally