The "best" way the way I would see it, would be to build a middleware layer in something like Node.js that implements a websocket connection and a REST fallback, the passes that on to the C++ app and listens for the response. This is the "best" imo, because it's easy. It takes almost nothing to put this together. This is how most applications that leverage C++ processing work. Node is not a requirement, it can he switched out for anything that is good at listening to websockets and http requests.
The most performant way would be to build the Websocket/REST in C++ and have the chat bot listen for them directly. Doing this will probably be more work than it's worth.
You'll need to do it in some way to talk to the web layer (Node or whatever), but if you use a web layer you won't need to implement fallbacks and can use whatever communication protocol is easiest to build in C++ or even better... have them communicate through a message queue like RabbitMQ.