DefaultCustomBehaviourContextAndTypeReceiver

Behaviour wrapper that injects a lazily-evaluated, cached provider of bot information into the BehaviourContext.

When this wrapper is used, any code executed inside it may call BehaviourContext.botInfo to obtain the current bot's ExtendedBot information. The info is fetched via GetMe only once and then cached for subsequent calls, with concurrent access synchronized by a mutex.

Parameters

BC

Type of BehaviourContext used in the wrapped logic.

R

Result type produced by the wrapped receiver.

U

Type of Update handled by the wrapped receiver.

wrapperReceiver

The original receiver to be invoked after the bot info provider is registered in the context.

Constructors

constructor(wrapperReceiver: CustomBehaviourContextAndTypeReceiver<BC, R, U>)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
fun interface IReceiver

Lightweight provider of bot information bound to a BehaviourContext.

Functions

Link copied to clipboard
operator fun invoke(data: BehaviourContextData)

open suspend operator override fun invoke(p1: BC, p2: U): R

Registers the internal bot info provider in BehaviourContext.data and then delegates to wrapperReceiver.