Skip to content

FAQ

What is the error Failed to load class "org.slf4j.impl.StaticLoggerBinder"?

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

This error is just a warning about the absence of slf4j setup. You may fix this error by following to stackoverflow answer


How to filter updates in some part of BehaviourBuilder?

You may create subcontext with BehaviourBuilder.createSubContextAndDoWithUpdatesFilter and pass there updatesUpstreamFlow parameter with any operations over parent behaviour builder:

buildBehaviourWithLongPolling {
    createSubContextAndDoWithUpdatesFilter(
        updatesUpstreamFlow = filter { /* some condition */ },
        stopOnCompletion = false // disable stopping of sub context after setup
    ) {
        onCommand() //...
    }
}

Additional info

Cases

  • Filtering of chats and users:
        updatesUpstreamFlow = filter { it.sourceChat() ?.id == requiredChatId || it.sourceUser() ?.id == requiredUserId }