From 34bcd7c1ef6548d92b848ae5dcb960052ca15730 Mon Sep 17 00:00:00 2001 From: Netkas Date: Tue, 14 Feb 2023 21:15:07 -0500 Subject: [PATCH] Added method \TgBotLib > Bot > getMe() --- src/TgBotLib/Bot.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/TgBotLib/Bot.php b/src/TgBotLib/Bot.php index 44fdb3e..0bb2e5a 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\User; use TgBotLib\Objects\Telegram\WebhookInfo; class Bot @@ -214,4 +215,16 @@ { return WebhookInfo::fromArray($this->sendRequest('getWebhookInfo')); } + + /** + * A simple method for testing your bot's authentication token. Requires no parameters. Returns basic + * information about the bot in form of a User object. + * + * @return User + * @throws TelegramException + */ + public function getMe(): User + { + return User::fromArray($this->sendRequest('getMe')); + } } \ No newline at end of file