H
H
hollanditkzn2017-07-31 16:50:22
Yii
hollanditkzn, 2017-07-31 16:50:22

Why do I get an error when I connect to the BotApi class?

I have such a problem with Fatal error: Class 'TelegramBot\Api\BotApi' not found in C:\OpenServer\domains\crm\frontend\components\Telegram.php on line 8
Implemented the code like this

<?php

namespace frontend\components;

use TelegramBot\Api\BotApi;
/** @var string $bot */

$bot = new BotApi('1234');

In composer I have already downloaded https://github.com/TelegramBot/Api. But it is not clear why he writes that the class was not found. Do I need to write a telegram bot in pure php, or am I doing something wrong? Or is it always necessary to write in the url?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-07-31
@webinar

\TelegramBot\Api
Slash at the beginning

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question