diff --git a/src/TgBotLib/Bot.php b/src/TgBotLib/Bot.php index 6dabf6c..44fdb3e 100644 --- a/src/TgBotLib/Bot.php +++ b/src/TgBotLib/Bot.php @@ -6,6 +6,7 @@ use TgBotLib\Exceptions\TelegramException; use TgBotLib\Objects\Telegram\Update; + use TgBotLib\Objects\Telegram\WebhookInfo; class Bot { @@ -201,4 +202,16 @@ 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')); + } } \ No newline at end of file