The middleware logic in ConnectMiddleware automatically forwards messages if connected, but this won't be flexible enough for some use cases. For example, the bot may need to handle some global commands even if connected to another user.
We should separate the forwarding logic and expose it here, but let the developer implement the middleware themselves based on their case. The bot-to-human handoff sample can implement one as an example.
The middleware logic in
ConnectMiddleware
automatically forwards messages if connected, but this won't be flexible enough for some use cases. For example, the bot may need to handle some global commands even if connected to another user.We should separate the forwarding logic and expose it here, but let the developer implement the middleware themselves based on their case. The bot-to-human handoff sample can implement one as an example.