Skip to content

Chatbot survey - #200

Merged
MJoaaquin merged 11 commits into
developfrom
chatbot-survey
Sep 1, 2026
Merged

Chatbot survey#200
MJoaaquin merged 11 commits into
developfrom
chatbot-survey

Conversation

@MJoaaquin

@MJoaaquin MJoaaquin commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds per-map bot configuration. The bot is off by default: it sends nothing
until the map owner configures it and enables it for a live device.

With the bot enabled, when content arrives from a new mapper the bot guides them: it asks
for a photo/video/audio, asks for the location, and — if the owner configured them — runs a
survey of single-choice and free-text questions. Answers are stored per point
and shown in the map popup. After several invalid replies in a row, the bot offers to
cancel or restart the mapping.

How the bot gets enabled

  • Off by default. maps.bot_active starts as false. While it is false, the
    listener does not even pick up that device's messages for the bot: only devices whose
    live map has bot_active = true are processed.
  • The owner configures the messages and questions from a new page (Bot setup,
    /bot-setup/:id), reached via the robot button on each live map in the list. Non-live
    maps have no bot.
  • A toggle enables the bot for that map. It cannot be enabled with an incomplete
    configuration
    : the PUT checks that every message the bot needs is present and returns
    422 if any is missing. A partial configuration can still be saved with the bot off.
  • The bot runs for a device only if its live map has bot_active = true and a complete
    configuration. Otherwise the message passes straight through to the pairing pipeline.
  • Unlinking the map (PUT /map/{id}/unlink/) turns off bot_active along with is_live.

@MJoaaquin MJoaaquin self-assigned this Aug 4, 2026
@MJoaaquin MJoaaquin added the enhancement New feature or request label Aug 4, 2026
@MJoaaquin
MJoaaquin marked this pull request as draft August 4, 2026 20:40
@MJoaaquin
MJoaaquin marked this pull request as ready for review September 1, 2026 02:52
@MJoaaquin
MJoaaquin merged commit 9dcc5cc into develop Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant