add-wizard-handler
Configures @WizardHandler annotation for wizard flows. Use when creating a new wizard, setting wizard triggers, scope, or state managers for the telegram-bot library.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Add Wizard Handler
Structure
Annotate an object or class with @WizardHandler. Nest WizardStep objects inside. KSP generates WizardActivity; no manual Activity class.
@WizardHandler(trigger = ["/start"])
object MyWizard {
object NameStep : WizardStep(isInitial = true) { ... }
object AgeStep : WizardStep { ... }
}
Parameters
| Parameter | Purpose | Default |
|---|---|---|
trigger |
Commands that start the wizard | Required |
scope |
Update types to check for trigger | [UpdateType.MESSAGE] |
stateManagers |
State manager classes for step storage | MapStringStateManager, MapIntStateManager, MapLongStateManager |
Trigger
-
trigger = ["/start"]— single command -
trigger = ["/start", "/register"]— multiple commands
Scope
-
scope = [UpdateType.MESSAGE]— commands in messages (default) -
scope = [UpdateType.CALLBACK_QUERY]— button-triggered wizard
State Managers
KSP matches each step's store() return type to a state manager:
-
String?→MapStringStateManager -
Int?→MapIntStateManager -
Long?→MapLongStateManager
Override per step with @WizardHandler.StateManager:
@WizardHandler(trigger = ["/start"], stateManagers = [CustomStateManager::class])
object MyWizard {
object NameStep : WizardStep { ... }
@WizardHandler.StateManager(OtherStateManager::class)
object AgeStep : WizardStep { ... }
}
Related Skills
- build-wizard-flow — Full wizard flow overview
- add-wizard-step — Implement WizardStep for each step
Reference
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-03-11
- Index updated
- 2026-03-11
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!