mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-24 11:08:43 +00:00
small improvements
This commit is contained in:
parent
0416b200b8
commit
1c94e86b40
@ -20,7 +20,10 @@ suspend inline fun <reified O : MessageContent> BehaviourContext.waitContent(
|
||||
): Flow<O> = waitContentMessage<O>(initRequest, errorFactory).map { it.content }
|
||||
|
||||
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(
|
||||
includeMediaGroupsDeprecationMessage,
|
||||
ReplaceWith("waitAnyContent(initRequest, errorFactory)", "dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitAnyContent")
|
||||
)
|
||||
suspend fun BehaviourContext.waitContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -66,7 +69,7 @@ suspend fun BehaviourContext.waitVenue(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContent<VenueContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitAudioMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -76,7 +79,7 @@ suspend fun BehaviourContext.waitAudioMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
) = waitContent<AudioMediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitDocumentMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -86,7 +89,7 @@ suspend fun BehaviourContext.waitDocumentMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContent<DocumentMediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitMedia(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -96,7 +99,7 @@ suspend fun BehaviourContext.waitMedia(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContent<MediaContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitAnyMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -106,7 +109,7 @@ suspend fun BehaviourContext.waitAnyMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
) = waitContent<MediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitVisualMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -116,7 +119,7 @@ suspend fun BehaviourContext.waitVisualMediaGroupContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
) = waitContent<VisualMediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitTextedMediaContent(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -130,7 +133,7 @@ suspend fun BehaviourContext.waitAnimation(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContent<AnimationContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitAudio(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -140,7 +143,7 @@ suspend fun BehaviourContext.waitAudio(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
) = waitContent<AudioContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitDocument(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -150,7 +153,7 @@ suspend fun BehaviourContext.waitDocument(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
) = waitContent<DocumentContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitPhoto(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -164,7 +167,7 @@ suspend fun BehaviourContext.waitSticker(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContent<StickerContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitVideo(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
|
@ -13,6 +13,7 @@ import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
const val includeMediaGroupsDeprecationMessage = "includeMediaGroups is deprecated and its usage will not lead to any changes"
|
||||
typealias CommonMessageToCommonMessageMapper<T> = suspend CommonMessage<T>.() -> CommonMessage<T>?
|
||||
|
||||
@RiskFeature(lowLevelRiskFeatureMessage)
|
||||
@ -46,7 +47,10 @@ internal inline fun <reified T : MessageContent> contentMessageConverter(
|
||||
if (content is T) this as CommonMessage<T> else null
|
||||
}
|
||||
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(
|
||||
includeMediaGroupsDeprecationMessage,
|
||||
ReplaceWith("waitAnyContentMessage(initRequest, errorFactory)", "dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitAnyContentMessage")
|
||||
)
|
||||
suspend fun BehaviourContext.waitContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -92,7 +96,7 @@ suspend fun BehaviourContext.waitVenueMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<VenueContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitAudioMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -102,7 +106,7 @@ suspend fun BehaviourContext.waitAudioMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<AudioMediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitDocumentMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -112,7 +116,7 @@ suspend fun BehaviourContext.waitDocumentMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<DocumentMediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitMediaMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -122,7 +126,7 @@ suspend fun BehaviourContext.waitMediaMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<MediaContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitAnyMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -132,7 +136,7 @@ suspend fun BehaviourContext.waitAnyMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<MediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitVisualMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -142,7 +146,7 @@ suspend fun BehaviourContext.waitVisualMediaGroupContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<VisualMediaGroupPartContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitTextedMediaContentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -156,7 +160,7 @@ suspend fun BehaviourContext.waitAnimationMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<AnimationContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitAudioMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -166,7 +170,7 @@ suspend fun BehaviourContext.waitAudioMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<AudioContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitDocumentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -176,7 +180,7 @@ suspend fun BehaviourContext.waitDocumentMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<DocumentContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitPhotoMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
@ -190,7 +194,7 @@ suspend fun BehaviourContext.waitStickerMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null }
|
||||
) = waitContentMessage<StickerContent>(initRequest, errorFactory)
|
||||
@Deprecated("includeMediaGroups is deprecated and its usage will not lead to any changes")
|
||||
@Deprecated(includeMediaGroupsDeprecationMessage)
|
||||
suspend fun BehaviourContext.waitVideoMessage(
|
||||
initRequest: Request<*>? = null,
|
||||
errorFactory: NullableRequestBuilder<*> = { null },
|
||||
|
Loading…
Reference in New Issue
Block a user