mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
suppressions nad compiler args
This commit is contained in:
parent
fb34b0bec1
commit
a0db95d929
@ -19,6 +19,9 @@
|
||||
* All deprecations was removed
|
||||
* `RequestException` now extends `io.ktor.utils.io.errors.IOException` instead of `kotlinx.io.IOException`
|
||||
* `Any#toJson` now is NOT `inline`
|
||||
* `FlowsUpdatesFilter` now as marked my annotation `FlowPreview`
|
||||
* `PathedFile#fullUrl` now is not `inline` function
|
||||
* `SimpleRequest#json` now is not `inline` and `internal` function
|
||||
|
||||
## 0.24.0
|
||||
|
||||
|
@ -81,4 +81,13 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
targets.all {
|
||||
compilations.all {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xopt-in=kotlin.RequiresOptIn"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ interface SimpleRequest<T: Any> : Request<T> {
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
inline fun <T: Any, K: SimpleRequest<T>> K.json(): JsonObject = toJsonWithoutNulls(requestSerializer as SerializationStrategy<K>)
|
||||
internal fun <T: Any, K: SimpleRequest<T>> K.json(): JsonObject = toJsonWithoutNulls(requestSerializer as SerializationStrategy<K>)
|
||||
|
@ -21,4 +21,4 @@ data class PathedFile(
|
||||
): TelegramMediaFile
|
||||
|
||||
fun TelegramAPIUrlsKeeper.resolveFileURL(file: PathedFile): String = "$fileBaseUrl/${file.filePath}"
|
||||
inline fun PathedFile.fullUrl(keeper: TelegramAPIUrlsKeeper): String = keeper.resolveFileURL(this)
|
||||
fun PathedFile.fullUrl(keeper: TelegramAPIUrlsKeeper): String = keeper.resolveFileURL(this)
|
||||
|
@ -28,7 +28,6 @@ data class PhotoSize(
|
||||
override val width: Int,
|
||||
override val height: Int
|
||||
) : SizedMediaFile {
|
||||
@Transient
|
||||
val resolution: Long by lazy {
|
||||
width.toLong() * height
|
||||
}
|
||||
|
@ -134,7 +134,6 @@ internal data class RawMessage(
|
||||
}
|
||||
}
|
||||
|
||||
@Transient
|
||||
private val forwarded: ForwardInfo? by lazy {
|
||||
forward_date ?: return@lazy null // According to the documentation, now any forwarded message contains this field
|
||||
when {
|
||||
|
@ -23,6 +23,8 @@ internal class TelegramBotAPIMessageDeserializationStrategyClass<T> : Deserializ
|
||||
override val descriptor: SerialDescriptor = SerialDescriptor("TelegramBotAPIMessageSerializer", PolymorphicKind.OPEN)
|
||||
|
||||
override fun patch(decoder: Decoder, old: T): T = throw UpdateNotSupportedException("TelegramBotAPIMessageSerializer")
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun deserialize(decoder: Decoder): T {
|
||||
return RawMessage.serializer().deserialize(decoder).asMessage as T
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.updateshandlers
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.channels.BroadcastChannel
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@ -10,6 +11,7 @@ import kotlinx.coroutines.flow.asFlow
|
||||
|
||||
private fun <T> BroadcastChannel<T>.createUpdateReceiver(): UpdateReceiver<T> = ::send
|
||||
|
||||
@FlowPreview
|
||||
class FlowsUpdatesFilter(
|
||||
broadcastChannelsSize: Int = Channel.CONFLATED
|
||||
): UpdatesFilter {
|
||||
|
Loading…
Reference in New Issue
Block a user