Package dev.inmo.tgbotapi.extensions.behaviour_builder.utils

Types

Link copied to clipboard
typealias SimpleFilter<T> = suspend (T) -> Boolean

Functions

Link copied to clipboard
suspend fun BehaviourContext.followLocation(message: ContentMessage<LiveLocationContent>, onLocation: BehaviourContextAndTypeReceiver<Unit, Location>)

Use this extension when you want to follow LiveLocation until it will became StaticLocation. This method is synchronous. You may use something like kotlinx.coroutines.launch or kotlinx.coroutines.async to run it asynchronously

Link copied to clipboard
fun <T> SimpleFilter<T>.listAll(): suspend (Iterable<T>) -> Boolean
Link copied to clipboard
fun <T> SimpleFilter<T>.listAny(): suspend (Iterable<T>) -> Boolean
Link copied to clipboard
fun <T> SimpleFilter<T>.listNone(): suspend (Iterable<T>) -> Boolean
Link copied to clipboard
operator fun <T> SimpleFilter<T>.not(): SimpleFilter<T>
operator fun <T> BehaviourContextAndTwoTypesReceiver<Boolean, T, Update>.not(): suspend BehaviourContext.(T, Update) -> Boolean

Reverse results of this

Link copied to clipboard
operator fun <T> SimpleFilter<T>?.plus(other: SimpleFilter<T>): SimpleFilter<T>

Makes an OR (||) operation between this and other

Link copied to clipboard
inline fun <T> SimpleFilter(noinline block: SimpleFilter<T>): suspend (T) -> Boolean
Link copied to clipboard
operator fun <T> SimpleFilter<T>?.times(other: SimpleFilter<T>): SimpleFilter<T>

Makes an AND (&&) operation between this and other