mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
deprecate TelegramBot#getStickerSet
This commit is contained in:
parent
62a9c687d5
commit
8ed216619d
@ -10,6 +10,9 @@
|
||||
* `Core`:
|
||||
* Add opportunity to create command text source and add command in entities builder
|
||||
via `BotCommamd` (thanks to [d1shin](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/664))
|
||||
* `API`:
|
||||
* New extensions `TelegramBot#getStickerSetOrNull` and `TelegramBot#getStickerSetOrThrow`
|
||||
* Old `TelegramBot#getStickerSet` has been deprecated
|
||||
* `Behaviour Builder`:
|
||||
* Add opportunity to use triggers and waiters with `BotCommand` (thanks to [d1shin](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/664))
|
||||
|
||||
|
@ -10,8 +10,21 @@ suspend fun TelegramBot.getStickerSet(
|
||||
GetStickerSet(name)
|
||||
)
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("getStickerSetOrThrow(sticker)", "dev.inmo.tgbotapi.extensions.api.get.getStickerSetOrThrow"))
|
||||
suspend fun TelegramBot.getStickerSet(
|
||||
sticker: Sticker
|
||||
) = getStickerSet(
|
||||
sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method")
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.getStickerSetOrNull(
|
||||
sticker: Sticker
|
||||
) = sticker.stickerSetName ?.let {
|
||||
getStickerSet(it)
|
||||
}
|
||||
|
||||
suspend fun TelegramBot.getStickerSetOrThrow(
|
||||
sticker: Sticker
|
||||
) = getStickerSet(
|
||||
sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user