mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
deprecate TelegramBot#getStickerSet
This commit is contained in:
parent
62a9c687d5
commit
8ed216619d
@ -10,6 +10,9 @@
|
|||||||
* `Core`:
|
* `Core`:
|
||||||
* Add opportunity to create command text source and add command in entities builder
|
* 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))
|
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`:
|
* `Behaviour Builder`:
|
||||||
* Add opportunity to use triggers and waiters with `BotCommand` (thanks to [d1shin](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/664))
|
* 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)
|
GetStickerSet(name)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Deprecated("Renamed", ReplaceWith("getStickerSetOrThrow(sticker)", "dev.inmo.tgbotapi.extensions.api.get.getStickerSetOrThrow"))
|
||||||
suspend fun TelegramBot.getStickerSet(
|
suspend fun TelegramBot.getStickerSet(
|
||||||
sticker: Sticker
|
sticker: Sticker
|
||||||
) = getStickerSet(
|
) = getStickerSet(
|
||||||
sticker.stickerSetName ?: error("Sticker must contains stickerSetName to be correctly used in getStickerSet method")
|
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