1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-25 19:48:43 +00:00

warnings fixes

This commit is contained in:
InsanusMokrassar 2020-05-09 21:04:56 +06:00
parent 3ee84700f4
commit 9747c8bff1
5 changed files with 7 additions and 9 deletions

View File

@ -68,7 +68,9 @@ fun RequestsExecutor.startGettingOfUpdates(
* [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
*/
@FlowPreview
@PreviewFeature
@Suppress("unused")
fun RequestsExecutor.startGettingFlowsUpdates(
timeoutSeconds: Seconds = 30,
scope: CoroutineScope = CoroutineScope(Dispatchers.Default),
@ -137,6 +139,7 @@ fun RequestsExecutor.startGettingOfUpdates(
)
}
@Suppress("unused")
fun RequestsExecutor.startGettingOfUpdates(
messageCallback: UpdateReceiver<MessageUpdate>? = null,
mediaGroupCallback: UpdateReceiver<MediaGroupUpdate>? = null,

View File

@ -85,7 +85,7 @@ fun Poll.createRequest(
correctOptionId,
isAnonymous,
isClosed,
caption ?.fullListOfSubSource(captionEntities) ?.justTextSources() ?.toMarkdownV2Captions() ?.firstOrNull(),
explanation ?.fullListOfSubSource(explanationEntities) ?.justTextSources() ?.toMarkdownV2Captions() ?.firstOrNull(),
MarkdownV2,
scheduledCloseInfo,
disableNotification,

View File

@ -212,8 +212,8 @@ internal object PollSerializer : KSerializer<Poll> {
value.isAnonymous,
regularPollType,
correctOptionId = value.correctOptionId,
explanation = value.caption,
explanationEntities = value.captionEntities.asRawMessageEntities(),
explanation = value.explanation,
explanationEntities = value.explanationEntities.asRawMessageEntities(),
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.seconds ?.toLong(),
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000L)
)

View File

@ -3,6 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.utils
import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.json.*
@Suppress("EXPERIMENTAL_API_USAGE")
internal val nonstrictJsonFormat = Json {
isLenient = true
ignoreUnknownKeys = true

View File

@ -4,9 +4,3 @@ import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
val TestsJsonFormat = Json(JsonConfiguration.Stable)
val NonstrictTestsJsonFormat = Json {
isLenient = true
ignoreUnknownKeys = true
serializeSpecialFloatingPointValues = true
useArrayPolymorphism = true
}