mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-22 16:47:13 +00:00
fill changelog and fix several issues
This commit is contained in:
parent
8e02a702f1
commit
f81d28dd5f
@ -5,7 +5,9 @@
|
||||
[Bot API 6.5](https://core.telegram.org/bots/api-changelog#february-3-2023) support
|
||||
|
||||
* `Core`:
|
||||
* [Bot API 6.5](https://core.telegram.org/bots/api#february-3-2023) support
|
||||
* `ChatPermissions` now is interface and have two main realizations: `ChatPermissions.Granular` and
|
||||
`ChatPermissions.Common`
|
||||
* `RestrictedChatMember` now implements `ChatPermissions` too
|
||||
|
||||
## 5.0.2
|
||||
|
||||
|
@ -7,7 +7,7 @@ import kotlin.random.Random
|
||||
@Serializable
|
||||
@JvmInline
|
||||
value class RequestId(
|
||||
val float: Int
|
||||
val int: Int
|
||||
) {
|
||||
companion object {
|
||||
fun random() = RequestId(Random.nextInt())
|
||||
|
@ -1,5 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.request
|
||||
|
||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||
|
||||
@ClassCastsIncluded
|
||||
sealed interface RequestResponse {
|
||||
val requestId: RequestId
|
||||
}
|
||||
|
@ -436,6 +436,7 @@ import dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuer
|
||||
import dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType
|
||||
import dev.inmo.tgbotapi.types.request.ChatShared
|
||||
import dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
||||
import dev.inmo.tgbotapi.types.request.RequestResponse
|
||||
import dev.inmo.tgbotapi.types.request.UserShared
|
||||
import dev.inmo.tgbotapi.types.update.CallbackQueryUpdate
|
||||
import dev.inmo.tgbotapi.types.update.ChannelPostUpdate
|
||||
@ -4718,6 +4719,33 @@ public inline fun Poll.quizPollOrThrow(): QuizPoll = this as dev.inmo.tgbotapi.t
|
||||
|
||||
public inline fun <T> Poll.ifQuizPoll(block: (QuizPoll) -> T): T? = quizPollOrNull() ?.let(block)
|
||||
|
||||
public inline fun RequestResponse.chatSharedOrNull(): ChatShared? = this as?
|
||||
dev.inmo.tgbotapi.types.request.ChatShared
|
||||
|
||||
public inline fun RequestResponse.chatSharedOrThrow(): ChatShared = this as
|
||||
dev.inmo.tgbotapi.types.request.ChatShared
|
||||
|
||||
public inline fun <T> RequestResponse.ifChatShared(block: (ChatShared) -> T): T? =
|
||||
chatSharedOrNull() ?.let(block)
|
||||
|
||||
public inline fun RequestResponse.chatSharedRequestOrNull(): ChatSharedRequest? = this as?
|
||||
dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
||||
|
||||
public inline fun RequestResponse.chatSharedRequestOrThrow(): ChatSharedRequest = this as
|
||||
dev.inmo.tgbotapi.types.request.ChatSharedRequest
|
||||
|
||||
public inline fun <T> RequestResponse.ifChatSharedRequest(block: (ChatSharedRequest) -> T): T? =
|
||||
chatSharedRequestOrNull() ?.let(block)
|
||||
|
||||
public inline fun RequestResponse.userSharedOrNull(): UserShared? = this as?
|
||||
dev.inmo.tgbotapi.types.request.UserShared
|
||||
|
||||
public inline fun RequestResponse.userSharedOrThrow(): UserShared = this as
|
||||
dev.inmo.tgbotapi.types.request.UserShared
|
||||
|
||||
public inline fun <T> RequestResponse.ifUserShared(block: (UserShared) -> T): T? =
|
||||
userSharedOrNull() ?.let(block)
|
||||
|
||||
public inline fun Update.callbackQueryUpdateOrNull(): CallbackQueryUpdate? = this as?
|
||||
dev.inmo.tgbotapi.types.update.CallbackQueryUpdate
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user