Added the ability to get the current bot short description in the given language as the class [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) using the method \TgBotLib\Bot > getMyShortDescription()
see [getMyShortDescription](https://core.telegram.org/bots/api#getmyshortdescription) for more information.
This commit is contained in:
parent
5c1bb7c936
commit
38012104ae
3 changed files with 73 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
use TgBotLib\Interfaces\ObjectTypeInterface;
|
||||
use TgBotLib\Objects\Telegram\BotCommandScope;
|
||||
use TgBotLib\Objects\Telegram\BotDescription;
|
||||
use TgBotLib\Objects\Telegram\BotShortDescription;
|
||||
use TgBotLib\Objects\Telegram\Chat;
|
||||
use TgBotLib\Objects\Telegram\ChatAdministratorRights;
|
||||
use TgBotLib\Objects\Telegram\ChatInviteLink;
|
||||
|
@ -2197,6 +2198,24 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method to get the current bot short description for the given user language.
|
||||
* Returns BotShortDescription on success.
|
||||
*
|
||||
* @param string|null $language_code A two-letter ISO 639-1 language code or an empty string
|
||||
* @param array $options Optional parameters
|
||||
* @return BotShortDescription
|
||||
* @throws TelegramException
|
||||
* @link https://core.telegram.org/bots/api#getmyshortdescription
|
||||
* @noinspection PhpUnused
|
||||
*/
|
||||
public function getMyShortDescription(?string $language_code=null, array $options=[]): BotShortDescription
|
||||
{
|
||||
return BotShortDescription::fromArray($this->sendRequest('getMyShortDescription', 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