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

Enabe long-polling for commandsHandler method #1133

Open PavelFil opened 4 months ago

PavelFil commented 4 months ago

PHP version

8.3

irazasyed/telegram-bot-sdk version

3.14

Laravel version (if any)

No response

Code To Reproduce the bug

In documentation we have the code $telegram->commandsHandler(false, ['timeout' => 30]);. But it doesn't work because the method commandsHandler doesn't take array as of second argument.

This is them code:

Telegram\Bot\Traits\CommandsHandler::commandsHandler(bool $webhook = false, ?RequestInterface $request = null): Update|array

There is no way to configure command handler to use ['timeout' => 30] param.

That functional was added on https://github.com/irazasyed/telegram-bot-sdk/pull/418 and removed at the moment.

Error stacktrace (if any)

No response