1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-28 19:47:13 +00:00

fixes and note in CHANGELOG

This commit is contained in:
InsanusMokrassar 2024-01-05 13:45:30 +06:00
parent 05bfbfe381
commit 825ecc1d73
10 changed files with 34 additions and 14 deletions

View File

@ -2,6 +2,10 @@
## 10.0.0
**IN THIS UPDATE KLOCK DEPENDENCY CHANGED TO `com.soywiz.korge:korlibs-time` UP TO 5.3.0 VERSION**
**IN THIS UPDATE KRYPTO DEPENDENCY CHANGED TO `com.soywiz.korge:korlibs-crypto` UP TO 5.3.0 VERSION**
## 9.4.3
**IetfLanguageCode has been renamed to IetfLang in MicroUtils**

View File

@ -24,6 +24,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
import io.ktor.utils.io.core.Closeable
import korlibs.time.millisecondsLong
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.currentCoroutineContext

View File

@ -16,6 +16,8 @@ import dev.inmo.tgbotapi.types.message.content.PollContent
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.types.polls.*
import dev.inmo.tgbotapi.utils.extensions.makeString
import korlibs.time.millisecondsLong
import korlibs.time.seconds
import kotlinx.serialization.*
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<PollContent>> = TelegramBotAPIMessageDeserializationStrategyClass()

View File

@ -145,7 +145,7 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
MapperSerializer<CreateNewStickerSet.SurrogateCreateNewSticker, CreateNewStickerSet>(
CreateNewStickerSet.SurrogateCreateNewSticker.serializer(),
{
{ it ->
CreateNewStickerSet.SurrogateCreateNewSticker(
it.userId,
it.name,
@ -156,7 +156,7 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
(it as? CreateNewStickerSet.CustomEmoji)?.needsRepainting
)
},
{
{ it ->
when (it.stickerType) {
StickerType.CustomEmoji -> CreateNewStickerSet.CustomEmoji(
it.userId,

View File

@ -57,7 +57,7 @@ sealed interface InputSticker {
object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<InputStickerSerializer.SurrogateInputSticker, InputSticker>(
SurrogateInputSticker.serializer(),
{
{ it ->
when (it) {
is InputSticker.Mask -> SurrogateInputSticker(
it.sticker,
@ -82,7 +82,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
)
}
},
{
{ it ->
when (it.internalType) {
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
it.sticker,

View File

@ -11,7 +11,7 @@ value class ColorId(
) {
companion object {
val defaultAccentColors = mapOf(
ColorId(0) to HEXAColor(0xff0000ffu),
ColorId(0) to setOf(HEXAColor(0xff0000ffu)),
)
}
}

View File

@ -5,6 +5,7 @@ import korlibs.time.seconds
import dev.inmo.tgbotapi.types.Seconds
import dev.inmo.tgbotapi.types.durationField
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent
import korlibs.time.milliseconds
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

View File

@ -11,6 +11,7 @@ import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.utils.RiskFeature
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
import korlibs.time.seconds
import kotlinx.serialization.*
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder

View File

@ -122,6 +122,7 @@ import dev.inmo.tgbotapi.types.chat.ExtendedChat
import dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername
import dev.inmo.tgbotapi.types.chat.ExtendedForumChat
import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat
import dev.inmo.tgbotapi.types.chat.ExtendedNonBotChat
import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat
import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat
import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat
@ -1980,6 +1981,24 @@ public inline fun Chat.unknownExtendedChatOrThrow(): UnknownExtendedChat = this
public inline fun <T> Chat.ifUnknownExtendedChat(block: (UnknownExtendedChat) -> T): T? =
unknownExtendedChatOrNull() ?.let(block)
public inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as?
dev.inmo.tgbotapi.types.chat.ExtendedChat
public inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as
dev.inmo.tgbotapi.types.chat.ExtendedChat
public inline fun <T> Chat.ifExtendedChat(block: (ExtendedChat) -> T): T? = extendedChatOrNull()
?.let(block)
public inline fun Chat.extendedNonBotChatOrNull(): ExtendedNonBotChat? = this as?
dev.inmo.tgbotapi.types.chat.ExtendedNonBotChat
public inline fun Chat.extendedNonBotChatOrThrow(): ExtendedNonBotChat = this as
dev.inmo.tgbotapi.types.chat.ExtendedNonBotChat
public inline fun <T> Chat.ifExtendedNonBotChat(block: (ExtendedNonBotChat) -> T): T? =
extendedNonBotChatOrNull() ?.let(block)
public inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as?
dev.inmo.tgbotapi.types.chat.ExtendedChannelChat
@ -2034,15 +2053,6 @@ public inline fun Chat.extendedForumChatOrThrow(): ExtendedForumChat = this as
public inline fun <T> Chat.ifExtendedForumChat(block: (ExtendedForumChat) -> T): T? =
extendedForumChatOrNull() ?.let(block)
public inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as?
dev.inmo.tgbotapi.types.chat.ExtendedChat
public inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as
dev.inmo.tgbotapi.types.chat.ExtendedChat
public inline fun <T> Chat.ifExtendedChat(block: (ExtendedChat) -> T): T? = extendedChatOrNull()
?.let(block)
public inline fun Chat.extendedChatWithUsernameOrNull(): ExtendedChatWithUsername? = this as?
dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername

View File

@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.polls.*
import dev.inmo.tgbotapi.utils.RiskFeature
import korlibs.time.seconds
import kotlinx.serialization.json.jsonPrimitive
@RiskFeature(RawFieldsUsageWarning)