Rechercher

PythonReactSEOPDF
GitHub Skill

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.

vendelieu☆ 244 Étoiles du dépôt18 Forks du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

Voir la source ↗Guides

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

Exemples

Consultez les exemples du dépôt source.

Voir la source ↗

Historique source

Date d’indexation
2026-03-11
Mise à jour de l’index
2026-03-11
Branch
main

Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.

GitHub ↗

chat Comments (0)

chat_bubble_outline

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