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