add-wizard-handler | Skill Performance & Reviews | TopRankSkills

TopRank Skills

Home / Skills / tools / add-wizard-handler

add-wizard-handler

maintained by vendelieu

star 244 account_tree 18 verified_user MIT License
bolt View GitHub

name: add-wizard-handler description: Configures @WizardHandler annotation for wizard flows. Use when creating a new wizard, setting wizard triggers, scope, or state managers for the telegram-bot library.

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

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!

Skill Details

GitHub Stars 244
GitHub Forks 18
Created Mar 2026
Last Updated 3个月前
tools tools ide plugins

Related Skills

writing-skills
chevron_right
codex
chevron_right
smart-illustrator
chevron_right
collaborating-with-codex
chevron_right
code-review-router
chevron_right

Build your own?

Join 12,000+ developers contributing to the Claude ecosystem.