From 8e9d5b4f1de62290c16f071b2758e881262584d7 Mon Sep 17 00:00:00 2001 From: Akulij Date: Sun, 18 May 2025 16:30:46 +0300 Subject: [PATCH] add stateful_msg_handlers example to mainbot.js --- mainbot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mainbot.js b/mainbot.js index c01ec3a..2c56953 100644 --- a/mainbot.js +++ b/mainbot.js @@ -10,6 +10,15 @@ const dialog = { state: "none" }, }, + stateful_msg_handlers: { + start: {}, // everything is by default, so just send message `start` + enter_name: { + handler: "enter_name", // name of the handler function. This field has a + // side effect: when is set, no automatic sending + // of message, should be sent manually in handler + state: "none" + }, + } } const fmt = (number) => number.toString().padStart(2, '0');