Added method \TgBotLib > Bot > getMe()
This commit is contained in:
parent
1c32980541
commit
34bcd7c1ef
1 changed files with 13 additions and 0 deletions
|
@ -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'));
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue