Added the ability to get the current bot description in the given language as the class [BotDescription](https://core.telegram.org/bots/api#botdescription) using the method \TgBotLib\Bot > getMyDescription()
This commit is contained in:
parent
7252854c44
commit
ccd910938b
3 changed files with 72 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
use TgBotLib\Interfaces\EventInterface;
|
||||
use TgBotLib\Interfaces\ObjectTypeInterface;
|
||||
use TgBotLib\Objects\Telegram\BotCommandScope;
|
||||
use TgBotLib\Objects\Telegram\BotDescription;
|
||||
use TgBotLib\Objects\Telegram\Chat;
|
||||
use TgBotLib\Objects\Telegram\ChatAdministratorRights;
|
||||
use TgBotLib\Objects\Telegram\ChatInviteLink;
|
||||
|
@ -2156,6 +2157,22 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method to get the current bot description for the given user language.
|
||||
* Returns BotDescription on success.
|
||||
*
|
||||
* @param string|null $language_code
|
||||
* @param array $options
|
||||
* @return BotDescription
|
||||
* @throws TelegramException
|
||||
*/
|
||||
public function getMyDescription(?string $language_code=null, array $options=[]): BotDescription
|
||||
{
|
||||
return BotDescription::fromArray($this->sendRequest('getMyDescription', array_merge([
|
||||
'language_code' => $language_code
|
||||
], $options)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method to change the bot's menu button in a private chat, or the default menu button.
|
||||
* Returns True on success.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue