code: function demo(message) {
      return __awaiter(this, void 0, void 0, function* () {
          console.log(message);
          if (!message.msg)
              return;
          if (/tell everyone/i.test(message.msg)) {
              const match = message.msg.match(/tell everyone (.*)/i);
              if (!match || !match[1])
                  return;
              const sayWhat = `@${message.u.username} says "${match[1]}"`;
              const usernames = yield __1.api.users.allNames();
              for (let username of usernames) {
                  if (username !== config_1.botUser.username) {
                      const toWhere = yield __1.driver.getDirectMessageRoomId(username);
                      yield __1.driver.sendToRoomId(sayWhat, toWhere); // DM ID hax
                      yield delay(200); // delay to prevent rate-limit error
                  }
              }
          }
          else if (/who\'?s online/i.test(message.msg)) {
              const names = yield __1.api.users.onlineNames();
              const niceNames = names.join(', ').replace(/, ([^,]*)$/, ' and $1');
              yield __1.driver.sendToRoomId(niceNames + ' are online', message.rid);
          }
      });
  }
docs: Demo bot-style interactions A: Listen for "tell everyone <something>" and send that something to everyone B: Listen for "who's online" and tell that person who's online