I'd like to introduce a new utility called Client Commands, a solution created to allow the Rocket.Chat server to trigger actions in subscriber clients (bots and possibly other websocket clients). This is handled at the adapter and/or SDK level, not by final users (e.g. normal bot developers).
Bots subscribe to a message stream and respond to message events, but there's no way for the server to prompt them to do anything other than that.
In order to provide a range of new management features for administrating bot clients, getting data or triggering any non message response action, we need to send data to be interpreted by the client as a command. Such data, identified here by ClientCommands, could not be sent through the normal message stream, because:
- a) it would go to everyone, not just bot clients
- b) it would need hack workarounds to filter commands from normal message data
- c) it would be kept forever, bloating message collection storage