Added method \TgBotLib > Bot > getMe()

This commit is contained in:
Netkas 2023-02-14 21:15:07 -05:00
parent 1c32980541
commit 34bcd7c1ef

View file

@ -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'));
}
}