Telegram

Introduction

This driver uses unreal4u/telegram-api in order to interact with Telegram Bot API.

If you do not have a Telegram bot registered already, go through the official documentation in order to create one and obtain access token.

Installation

In order to support Telegram, you need to install driver.

Install it using artisan command:

php artisan fondbot:driver:install telegram

or install using Composer:

composer require fondbot/drivers-telegram

Configuration

Define Telegram channel in src/Providers/ChannelServiceProvider.php:

protected function channels(): array
{
    return [
        'telegram' => [
            'driver' => 'telegram',
            'token' => env('TELEGRAM_TOKEN'),
        ],
    ];
}

Registering Webhook

After defining telegram channel in service provider, you may wish to set webhook URL in order to receive updates from your Telegram bot.

Webhook limitations

Telegram requires only HTTPS for webhooks. We recommend valet share for development purposes.

Using artisan command you can set webhook url. Take note, that this command uses APP_URL from your .env file.

php artisan fondbot:driver:telegram:set-webhook
Last Updated: 8/27/2018, 9:34:51 PM