add stateful_msg_handlers example to mainbot.js

This commit is contained in:
Akulij 2025-05-18 16:30:46 +03:00
parent 05b298e61c
commit 8e9d5b4f1d

View File

@ -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');