Answer the question
In order to leave comments, you need to log in
PHP correct use of namespace, how to connect Telegram Bot SDK?
Hello!
I can’t connect and use the Telegram Bot SDK
in any way I can’t make the example work
use Telegram\Bot\Api;
$telegram = new Api('BOT TOKEN');
$response = $telegram->setWebhook(['url' => 'https://example.com/<token>/webhook']);
require_once ('./Api.php');
use Telegram\Bot\Api;
$telegram = new Api('BOT TOKEN');
$response = $telegram->setWebhook(['url' => 'https://example.com/<token>/webhook']);
Answer the question
In order to leave comments, you need to log in
First do
Then in your file
<?php
require __DIR__.'/vendor/autoload.php';
use Telegram\Bot\Api;
$telegram = new Api('BOT TOKEN');
$response = $telegram->setWebhook(['url' => 'https://example.com/<token>/webhook']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question