Multi-step Flows

Chain commands with handleNextCommand and runCommand.

handleNextCommand

Ask the user, then handle their next message in a dedicated command.

# Command: /ask
bot.replyText(u, "age?")
Bot.handleNextCommand("age")

# Command: age (trigger type "text", value "__never__" so not user-triggerable)
bot.replyText(u, "got " + text)

runCommand

Call another command, optionally passing options (available as params).

# Command: /a
bot.replyText(u, "A")
Bot.runCommand("helper", options="opt1")
bot.replyText(u, "A2")

# Command: helper (protected)
bot.replyText(u, "H " + str(params))
PREVIOUS
Handlers
NEXT
Database
Was this page helpful?
Last updated March 22, 2026