Skip to content
Sergey Lapin edited this page Mar 10, 2019 · 1 revision

Telegram Bot API

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. To learn how to create and set up a bot, please consult Introduction to Bots and Bot FAQ.

Making requests

<?php

namespace App\Http\Controllers;

use Wekser\Laragram\BotApi;

class BotController extends Controller
{
    /**
     * Start a new chat with bot.
     *
     * @return string
     */
    public function start()
    {
        $api = new BotApi();
        $api->sendChatAction(['action' => 'typing']);

        return 'Hello!';
    }
}

When chat_id is not specified, then the current authorized user ID will be used in the request.

Prologue

Getting Started

The Basics

Security

Clone this wiki locally