1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

add info about supported tgbotapi version

This commit is contained in:
InsanusMokrassar 2023-04-22 00:28:54 +06:00
parent 0ba6ebb20f
commit f5b2ee79d6
3 changed files with 68 additions and 1 deletions

View File

@ -2,6 +2,8 @@
## 7.1.0 ## 7.1.0
**This update contains changes according to the [Telegram Bot API 6.7](https://core.telegram.org/bots/api-changelog#april-21-2023)**
* `API`: * `API`:
* Rename `editMessageCaption` to `editMessageMedia` due to wrong old naming * Rename `editMessageCaption` to `editMessageMedia` due to wrong old naming
* Add `edit` extensions for `InlineMessageIdentifier`s * Add `edit` extensions for `InlineMessageIdentifier`s

View File

@ -1,4 +1,4 @@
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-6.6-blue)](https://core.telegram.org/bots/api-changelog#march-9-2023) # TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-6.7-blue)](https://core.telegram.org/bots/api-changelog#april-21-2023)
| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Bookstack&message=Tutorial&color=blue&logo=bookstack)](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) | | Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Bookstack&message=Tutorial&color=blue&logo=bookstack)](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|

View File

@ -12,9 +12,12 @@ package dev.inmo.tgbotapi.extensions.utils
import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData
import dev.inmo.tgbotapi.abstracts.FromUser import dev.inmo.tgbotapi.abstracts.FromUser
import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.abstracts.WithUser
import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink
import dev.inmo.tgbotapi.requests.send.payments.SendInvoice import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
import dev.inmo.tgbotapi.requests.stickers.InputSticker import dev.inmo.tgbotapi.requests.stickers.InputSticker
import dev.inmo.tgbotapi.types.ChatFolderInviteLink
import dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.types.ChatIdWithThreadId import dev.inmo.tgbotapi.types.ChatIdWithThreadId
import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.ChatIdentifier
@ -108,6 +111,7 @@ import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineK
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryChosenChatInlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton
@ -559,6 +563,25 @@ public inline fun WithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlim
public inline fun <T> WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? public inline fun <T> WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T?
= chatInviteLinkUnlimitedOrNull() ?.let(block) = chatInviteLinkUnlimitedOrNull() ?.let(block)
public inline fun WithUser.chatFolderInviteLinkOrNull(): ChatFolderInviteLink? = this as?
dev.inmo.tgbotapi.types.ChatFolderInviteLink
public inline fun WithUser.chatFolderInviteLinkOrThrow(): ChatFolderInviteLink = this as
dev.inmo.tgbotapi.types.ChatFolderInviteLink
public inline fun <T> WithUser.ifChatFolderInviteLink(block: (ChatFolderInviteLink) -> T): T? =
chatFolderInviteLinkOrNull() ?.let(block)
public inline fun WithUser.chatFolderInviteLinkUnlimitedOrNull(): ChatFolderInviteLinkUnlimited? =
this as? dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
public inline fun WithUser.chatFolderInviteLinkUnlimitedOrThrow(): ChatFolderInviteLinkUnlimited =
this as dev.inmo.tgbotapi.types.ChatFolderInviteLinkUnlimited
public inline fun <T>
WithUser.ifChatFolderInviteLinkUnlimited(block: (ChatFolderInviteLinkUnlimited) -> T): T? =
chatFolderInviteLinkUnlimitedOrNull() ?.let(block)
public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as?
dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult
@ -1013,6 +1036,36 @@ public inline fun <T>
WithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): WithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T):
T? = messageGameShortNameCallbackQueryOrNull() ?.let(block) T? = messageGameShortNameCallbackQueryOrNull() ?.let(block)
public inline fun InlineQueryResultsButton.startOrNull(): InlineQueryResultsButton.Start? = this as?
dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Start
public inline fun InlineQueryResultsButton.startOrThrow(): InlineQueryResultsButton.Start = this as
dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Start
public inline fun <T>
InlineQueryResultsButton.ifStart(block: (InlineQueryResultsButton.Start) -> T): T? =
startOrNull() ?.let(block)
public inline fun InlineQueryResultsButton.unknownOrNull(): InlineQueryResultsButton.Unknown? = this
as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Unknown
public inline fun InlineQueryResultsButton.unknownOrThrow(): InlineQueryResultsButton.Unknown = this
as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Unknown
public inline fun <T>
InlineQueryResultsButton.ifUnknown(block: (InlineQueryResultsButton.Unknown) -> T): T? =
unknownOrNull() ?.let(block)
public inline fun InlineQueryResultsButton.webAppOrNull(): InlineQueryResultsButton.WebApp? = this
as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp
public inline fun InlineQueryResultsButton.webAppOrThrow(): InlineQueryResultsButton.WebApp = this
as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp
public inline fun <T>
InlineQueryResultsButton.ifWebApp(block: (InlineQueryResultsButton.WebApp) -> T): T? =
webAppOrNull() ?.let(block)
public inline fun InputSticker.maskOrNull(): InputSticker.Mask? = this as? public inline fun InputSticker.maskOrNull(): InputSticker.Mask? = this as?
dev.inmo.tgbotapi.requests.stickers.InputSticker.Mask dev.inmo.tgbotapi.requests.stickers.InputSticker.Mask
@ -1898,6 +1951,18 @@ public inline fun <T>
InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T): InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T):
T? = switchInlineQueryCurrentChatInlineKeyboardButtonOrNull() ?.let(block) T? = switchInlineQueryCurrentChatInlineKeyboardButtonOrNull() ?.let(block)
public inline fun InlineKeyboardButton.switchInlineQueryChosenChatInlineKeyboardButtonOrNull():
SwitchInlineQueryChosenChatInlineKeyboardButton? = this as?
dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryChosenChatInlineKeyboardButton
public inline fun InlineKeyboardButton.switchInlineQueryChosenChatInlineKeyboardButtonOrThrow():
SwitchInlineQueryChosenChatInlineKeyboardButton = this as
dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryChosenChatInlineKeyboardButton
public inline fun <T>
InlineKeyboardButton.ifSwitchInlineQueryChosenChatInlineKeyboardButton(block: (SwitchInlineQueryChosenChatInlineKeyboardButton) -> T):
T? = switchInlineQueryChosenChatInlineKeyboardButtonOrNull() ?.let(block)
public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrNull(): public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrNull():
SwitchInlineQueryInlineKeyboardButton? = this as? SwitchInlineQueryInlineKeyboardButton? = this as?
dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton