code: function reactToMessages(callback) {
      log_1.logger.info(`[reactive] Listening for change events in collection ${exports.messages.name}`);
      exports.messages.reactiveQuery({}).on('change', (_id) => {
          const changedMessageQuery = exports.messages.reactiveQuery({ _id });
          if (changedMessageQuery.result && changedMessageQuery.result.length > 0) {
              const changedMessage = changedMessageQuery.result[0];
              if (Array.isArray(changedMessage.args)) {
                  log_1.logger.info(`[received] Message in room ${changedMessage.args[0].rid}`);
                  callback(null, changedMessage.args[0], changedMessage.args[1]);
              }
              else {
                  log_1.logger.debug('[received] Update without message args');
              }
          }
          else {
              log_1.logger.debug('[received] Reactive query at ID ${ _id } without results');
          }
      });
  }
docs: Once a subscription is created, using `subscribeToMessages` this method
  can be used to attach a callback to changes in the message stream.
  This can be called directly for custom extensions, but for most usage (e.g.
  for bots) the respondToMessages is more useful to only receive messages
  matching configuration.
  
  If the bot hasn't been joined to any rooms at this point, it will attempt to
  join now based on environment config, otherwise it might not receive any
  messages. It doesn't matter that this happens asynchronously because the
  bot's joined rooms can change after the reactive query is set up.
  
  @todo `reactToMessages` should call `subscribeToMessages` if not already
  done, so it's not required as an arbitrary step for simpler adapters.
  Also make `login` call `connect` for the same reason, the way
  `respondToMessages` calls `respondToMessages`, so all that's really
  required is:
  `driver.login(credentials).then(() => driver.respondToMessages(callback))`
  @param callback Function called with every change in subscriptions.
  - Uses error-first callback pattern
  - Second argument is the changed item
  - Third argument is additional attributes, such as `roomType`