Added method \TgBotLib > Bot > getWebhookInfo()

This commit is contained in:
Netkas 2023-02-14 21:14:18 -05:00
parent 71dc0b5bb6
commit 1c32980541

View file

@ -6,6 +6,7 @@
use TgBotLib\Exceptions\TelegramException; use TgBotLib\Exceptions\TelegramException;
use TgBotLib\Objects\Telegram\Update; use TgBotLib\Objects\Telegram\Update;
use TgBotLib\Objects\Telegram\WebhookInfo;
class Bot class Bot
{ {
@ -201,4 +202,16 @@
return true; return true;
} }
/**
* Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo
* object. If the bot is using getUpdates, will return an object with the url field empty.
*
* @return WebhookInfo
* @throws TelegramException
*/
public function getWebhookInfo(): WebHookInfo
{
return WebhookInfo::fromArray($this->sendRequest('getWebhookInfo'));
}
} }