1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +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 * [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,

View File

@ -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,

View File

@ -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)
) )

View File

@ -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

View File

@ -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
}