code: function rollTheDie(msg, text) {
      var conversationId = msg.conversation.id;
  
      var matches = text.match(/die (\d+)/i);
      if (matches && matches[1]) {
        var dieCount = Number(matches[1]);
        var result = [];
        if (dieCount > 20) {
          layerClient.messages.sendTextFromName(conversationId, 'Die-bot', 'So much death is a terrible thing to ask of me. You should be ashamed!');
        } else {
          for (var i = 0; i < dieCount; i++) {
            result.push(Math.floor(Math.random() * 6) + 1); // Simple 6 sided die
          }
          layerClient.messages.sendTextFromName(conversationId, 'Die-bot', 'Rolled a ' + result.join(', ').replace(/(.*),(.*)/, '$1 and$2'));
        }
      }
    }
docs: If someone sends the phrase "die 5" roll the dice 5 times and report the results