The code is for the HTTP server, as you asked, not to be used like in your last posted script.
The PowerShell script should also use parameter createBot. In the first call pass true, elsewhere false.
I did not test it, but I would try code like this. Maybe also need to ensure that the code always runs in the same thread, I don't know.
The PowerShell script should also use parameter createBot. In the first call pass true, elsewhere false.
I did not test it, but I would try code like this. Maybe also need to ensure that the code always runs in the same thread, I don't know.