irazasyed / telegram-bot-sdk

🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
https://telegram-bot-sdk.com
BSD 3-Clause "New" or "Revised" License
3.04k stars 671 forks source link

Fatal error: Uncaught Error: Call to undefined function GuzzleHttp\Promise\unwrap() #1086

Closed Maatify closed 1 year ago

Maatify commented 1 year ago

PHP version

8.0 or later

irazasyed/telegram-bot-sdk version

^3.9

Laravel version (if any)

No response

Code To Reproduce the bug

Fatal error: Uncaught Error: Call to undefined function GuzzleHttp\Promise\unwrap() in vendor\irazasyed\telegram-bot-sdk\src\HttpClients\GuzzleHttpClient.php:50 Stack trace:

0 [internal function]: Telegram\Bot\HttpClients\GuzzleHttpClient->__destruct()

1 {main}

thrown in vendor\irazasyed\telegram-bot-sdk\src\HttpClients\GuzzleHttpClient.php on line 50

Error stacktrace (if any)

Please Remove __destruct() method from src\HttpClients\GuzzleHttpClient.php on line 50

ershad7 commented 1 year ago

+1

hellodit commented 1 year ago

hi @irazasyed this bug is not fixed, please fix it. the MR already requested

gntlby commented 1 year ago

Hi, @irazasyed please fix..

hakhagmon commented 1 year ago

hot fix

open vendor/irazasyed/telegram-bot-sdk/src/HttpClients/GuzzleHttpClient.php

change

   public function __destruct()
    {
        Promise\unwrap (self::$promises);
    }

to

   public function __destruct()
    {
        Promise\Utils::unwrap (self::$promises);
    }
dario86 commented 1 year ago

hot fix

open vendor/irazasyed/telegram-bot-sdk/src/HttpClients/GuzzleHttpClient.php

change

   public function __destruct()
    {
        Promise\unwrap (self::$promises);
    }

to

   public function __destruct()
    {
        Promise\Utils::unwrap (self::$promises);
    }

I made a pull request some weeks ago