mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
Update BehaviourWithFSMStateHandlerHolder.kt
This commit is contained in:
parent
d55d8fa000
commit
3e58114eeb
@ -34,10 +34,9 @@ class BehaviourWithFSMStateHandlerHolder<I : O, O : State>(
|
|||||||
handleState(state as I)
|
handleState(state as I)
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun StatesMachine<in O>.handleState(state: O): O? = if (this is BehaviourContextWithFSM) {
|
override suspend fun StatesMachine<in O>.handleState(state: O): O? = with(delegateTo) {
|
||||||
handleState(state)
|
@Suppress("UNCHECKED_CAST")
|
||||||
} else {
|
handleState(state as I)
|
||||||
null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user