Bot Mapping Logic
Bot Mapping Logic
The Supervised AI Bots plugin uses a simple sequential mapping system to connect your chatbot URLs to the shortcodes used on your pages. Understanding this logic ensures you display the correct bot in the desired location.
How Mapping Works
The plugin identifies chatbots based on their position within the Supervised AI Bots settings page. When you enter multiple chatbot URLs into the configuration textarea, the plugin assigns a numerical ID to each URL based on its line number.
- Row 1 corresponds to
id="1" - Row 2 corresponds to
id="2" - Row 3 corresponds to
id="3" - ...and so on.
Configuration Example
If your settings textarea contains the following entries:
https://chat.supervised.co/bot/marketing-bot-123
https://chat.supervised.co/bot/support-bot-456
https://chat.supervised.co/bot/sales-assistant-789
The mapping logic will generate the following shortcode associations:
| Line Number | Bot URL | Required Shortcode |
| :--- | :--- | :--- |
| 1 | .../marketing-bot-123 | [supervised_ai_bot id="1"] |
| 2 | .../support-bot-456 | [supervised_ai_bot id="2"] |
| 3 | .../sales-assistant-789 | [supervised_ai_bot id="3"] |
Implementation Guide
To render a specific bot on a post or page, use the id attribute within the standard shortcode:
<!-- To display the first bot in your list -->
[supervised_ai_bot id="1"]
<!-- To display the second bot in your list -->
[supervised_ai_bot id="2"]
Important Considerations
- Line Order: If you rearrange the URLs in the settings page, the IDs will change automatically based on their new line numbers. Ensure you update your shortcodes if you change the sequence of URLs in the admin interface.
- Single URL per Line: Ensure each URL is on its own line. Extra spaces or multiple URLs on a single line may cause the mapping logic to fail or load incorrect bot configurations.
- Empty Lines: Avoid leaving blank lines between URLs, as the plugin counts every line (including empty ones) as a potential index. Empty lines may result in a shortcode attempting to load a null URL.