Bot ID Mapping Logic
Bot ID Mapping Logic
The Supervised AI Bots plugin uses a simple, line-based indexing system to map your chatbot URLs to shortcode IDs. This allows you to manage multiple bots from a single configuration field without needing to manually assign unique identifiers in a database.
How the Mapping Works
When you enter your bot URLs into the plugin settings, the system assigns an ID based on the row number (line number) of the URL in the textarea.
- Line 1 maps to
id="1" - Line 2 maps to
id="2" - Line 3 maps to
id="3" - ...and so on.
Configuration Example
If your "Supervised AI Bots" settings page contains the following list in the URL textarea:
https://supervised.co/bot/sales-assistant
https://supervised.co/bot/support-desk
https://supervised.co/bot/feedback-survey
The mapping logic will resolve the IDs as follows:
| Row Number | Bot URL | Shortcode to Use |
| :--- | :--- | :--- |
| 1 | .../sales-assistant | [supervised_ai_bot id="1"] |
| 2 | .../support-desk | [supervised_ai_bot id="2"] |
| 3 | .../feedback-survey | [supervised_ai_bot id="3"] |
Implementation in Pages and Posts
To display a specific bot on a page, simply use the [supervised_ai_bot] shortcode with the corresponding ID.
Example: Displaying the second bot in your list
[supervised_ai_bot id="2"]
Important Usage Notes
- Sequential Ordering: If you remove a URL from the middle of your list in the settings, the IDs of all bots below it will shift up by one. Ensure you update your shortcodes on your pages if you reorder or delete URLs from the settings list.
- Blank Lines: Avoid leaving blank lines between URLs, as the mapping logic counts every line. A blank line may result in an empty or broken chatbot popup for that specific ID.
- One URL per Line: Ensure each Supervised AI bot URL is on its own line for the mapping to function correctly.