mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
warnings fixes
This commit is contained in:
parent
3ee84700f4
commit
9747c8bff1
@ -68,7 +68,9 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
* [kotlinx.coroutines.flow.Flow.collect] on one of [FlowsUpdatesFilter] flows. To avoid it, you can pass
|
* [kotlinx.coroutines.flow.Flow.collect] on one of [FlowsUpdatesFilter] flows. To avoid it, you can pass
|
||||||
* [flowUpdatesPreset] lambda - it will be called BEFORE starting updates getting
|
* [flowUpdatesPreset] lambda - it will be called BEFORE starting updates getting
|
||||||
*/
|
*/
|
||||||
|
@FlowPreview
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
|
@Suppress("unused")
|
||||||
fun RequestsExecutor.startGettingFlowsUpdates(
|
fun RequestsExecutor.startGettingFlowsUpdates(
|
||||||
timeoutSeconds: Seconds = 30,
|
timeoutSeconds: Seconds = 30,
|
||||||
scope: CoroutineScope = CoroutineScope(Dispatchers.Default),
|
scope: CoroutineScope = CoroutineScope(Dispatchers.Default),
|
||||||
@ -137,6 +139,7 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
fun RequestsExecutor.startGettingOfUpdates(
|
fun RequestsExecutor.startGettingOfUpdates(
|
||||||
messageCallback: UpdateReceiver<MessageUpdate>? = null,
|
messageCallback: UpdateReceiver<MessageUpdate>? = null,
|
||||||
mediaGroupCallback: UpdateReceiver<MediaGroupUpdate>? = null,
|
mediaGroupCallback: UpdateReceiver<MediaGroupUpdate>? = null,
|
||||||
|
@ -85,7 +85,7 @@ fun Poll.createRequest(
|
|||||||
correctOptionId,
|
correctOptionId,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
caption ?.fullListOfSubSource(captionEntities) ?.justTextSources() ?.toMarkdownV2Captions() ?.firstOrNull(),
|
explanation ?.fullListOfSubSource(explanationEntities) ?.justTextSources() ?.toMarkdownV2Captions() ?.firstOrNull(),
|
||||||
MarkdownV2,
|
MarkdownV2,
|
||||||
scheduledCloseInfo,
|
scheduledCloseInfo,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
@ -212,8 +212,8 @@ internal object PollSerializer : KSerializer<Poll> {
|
|||||||
value.isAnonymous,
|
value.isAnonymous,
|
||||||
regularPollType,
|
regularPollType,
|
||||||
correctOptionId = value.correctOptionId,
|
correctOptionId = value.correctOptionId,
|
||||||
explanation = value.caption,
|
explanation = value.explanation,
|
||||||
explanationEntities = value.captionEntities.asRawMessageEntities(),
|
explanationEntities = value.explanationEntities.asRawMessageEntities(),
|
||||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.seconds ?.toLong(),
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.seconds ?.toLong(),
|
||||||
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000L)
|
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000L)
|
||||||
)
|
)
|
||||||
|
@ -3,6 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.utils
|
|||||||
import kotlinx.serialization.SerializationStrategy
|
import kotlinx.serialization.SerializationStrategy
|
||||||
import kotlinx.serialization.json.*
|
import kotlinx.serialization.json.*
|
||||||
|
|
||||||
|
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||||
internal val nonstrictJsonFormat = Json {
|
internal val nonstrictJsonFormat = Json {
|
||||||
isLenient = true
|
isLenient = true
|
||||||
ignoreUnknownKeys = true
|
ignoreUnknownKeys = true
|
||||||
|
@ -4,9 +4,3 @@ import kotlinx.serialization.json.Json
|
|||||||
import kotlinx.serialization.json.JsonConfiguration
|
import kotlinx.serialization.json.JsonConfiguration
|
||||||
|
|
||||||
val TestsJsonFormat = Json(JsonConfiguration.Stable)
|
val TestsJsonFormat = Json(JsonConfiguration.Stable)
|
||||||
val NonstrictTestsJsonFormat = Json {
|
|
||||||
isLenient = true
|
|
||||||
ignoreUnknownKeys = true
|
|
||||||
serializeSpecialFloatingPointValues = true
|
|
||||||
useArrayPolymorphism = true
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user