Added the ability to set different bot descriptions for different user languages using the method \TgBotLib\Bot > setMyDescription()

This commit is contained in:
Netkas 2023-04-06 13:22:09 -04:00
parent 855925d4bd
commit 7252854c44
2 changed files with 25 additions and 0 deletions

View file

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [6.6.0] - Unreleased
### Added
* Added the ability to set different bot descriptions for different user languages using the method `\TgBotLib\Bot > setMyDescription()`
### Changed
* Removed unused `__destruct()` method from `\TgBotLib\Bot`
* Added proper construction for `PollOption[]` objects in `TgBotLib\Objects\Telegram > Poll`

View file

@ -2134,6 +2134,28 @@
}, $this->sendRequest('getMyCommands', $options));
}
/**
* Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
* Returns True on success.
*
* @param string|null $description New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
* @param string|null $language_code A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
* @param array $options
* @return bool
* @throws TelegramException
* @link https://core.telegram.org/bots/api#setmydescription
* @noinspection PhpUnused
*/
public function setMyDescription(?string $description=null, ?string $language_code=null, array $options=[]): bool
{
$this->sendRequest('setMyDescription', array_merge([
'description' => $description,
'language_code' => $language_code
], $options));
return true;
}
/**
* Use this method to change the bot's menu button in a private chat, or the default menu button.
* Returns True on success.