telegram-bot-php / core

A PHP library that makes using Telegram Bot API much easier.
https://telegram.litehex.com/
MIT License
64 stars 7 forks source link

DEPRECATED: Creation of dynamic property #1

Closed BAD-WOLF closed 1 year ago

BAD-WOLF commented 1 year ago

This is my cod:

   
        <?php
        $br = PHP_EOL;
        $sp = DIRECTORY_SEPARATOR;
        require_once __DIR__ . $sp . "vendor" . $sp . "autoload.php";

        use TelegramBot\Entities\Update;
        use TelegramBot\Telegram;
        use TelegramBot\Request;

        $admin_id = 1269777916;
        $bot_token = "5801896630:AAEd0Z1FhgLZCFQqIbDOxe5E5KUj0ZlgRKw";
        $hook_url = "WEB HOOK URL";

        Telegram::setToken($bot_token);
        Telegram::setAdminId($admin_id);

        $response = Request::setWebhook([
            "url" => $hook_url,
            "certificate" => "./.cert/cert.crt"
        ]);

        if ($response->isOk()) {
            $result = Request::sendMessage([
                "chat_id" => $admin_id,
                "text" => $response->getResult()
            ]);
            echo $response->getDescription();
            exit(0);
        }

        print_r(Update::TYPE_MESSAGE);
        print_r($result->getRawData(false));

        ?>
      

This is my output:

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$curlHandle is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 46

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$statusCode is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 117

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$headerSize is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 117

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$headers is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 80

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$body is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 117

      Deprecated:  Creation of dynamic property TelegramBot\Entities\Response::$ok is deprecated in /data/data/com.termux/files/home/IA/vendor/telegram-bot-php/core/src/Entity.php on line 42

      Deprecated:  Creation of dynamic property TelegramBot\Entities\Response::$result is deprecated in /data/data/com.termux/files/home/IA/vendor/telegram-bot-php/core/src/Entity.php on line 42

      Deprecated:  Creation of dynamic property TelegramBot\Entities\Response::$description is deprecated in /data/data/com.termux/files/home/IA/vendor/telegram-bot-php/core/src/Entity.php on line 42

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$curlHandle is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 46

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$statusCode is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 117

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$headerSize is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 117

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$headers is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 80

      Deprecated:  Creation of dynamic property EasyHttp\Model\HttpResponse::$body is deprecated in /data/data/com.termux/files/home/IA/vendor/shahradelahi/easy-http/src/Model/HttpResponse.php on line 117

      Deprecated:  Creation of dynamic property TelegramBot\Entities\Response::$ok is deprecated in /data/data/com.termux/files/home/IA/vendor/telegram-bot-php/core/src/Entity.php on line 42

      Deprecated:  Creation of dynamic property TelegramBot\Entities\Response::$result is deprecated in /data/data/com.termux/files/home/IA/vendor/telegram-bot-php/core/src/Entity.php on line 42
    
shahradelahi commented 1 year ago

Library is pretty much outdated, and I do not recommend using it. There is a similar library for Telegram Bot API which you can use, but you're going to miss the Plugin feature. If there are any other questions, I'll be happy to answer.

p.s. you just compromised your bot token, please make sure to revoke it.

BAD-WOLF commented 1 year ago

Already revoked, thanks for the feedback 🤝