This commit is contained in:
Artem Tsyrulnikov
2026-01-15 22:02:16 +03:00
parent 6ec26c96e3
commit 049024ebe8
72 changed files with 2417 additions and 2054 deletions

View File

@@ -103,6 +103,11 @@ func (b *Bot) SetState(s State, mode RenderMode) {
Str("mode", fmt.Sprintf("%v", mode)).
Msg("State transition")
// Вызываем Exit() у старого состояния для cleanup (например, отмены горутин)
if b.CurrentState != nil {
b.CurrentState.Exit()
}
b.CurrentState = s
if b.exec != nil {