examples/basic-services/message-sent.js
function foodTalk (msg, text) {
    var conversationId = msg.conversation.id;

    var matches = text.match(/eat my (.+?)\b/i);
    if (matches) {
      layerClient.messages.sendTextFromName(conversationId, 'Food-bot', 'My ' + matches[1] + ' taste a lot better than yours');
    } else {
      var messages = [
        'I\'m eating yummy carbon',
        'I\'m eating yummy silicon',
        'I\'m eating your keyboard. Yummy!',
        'I\'m nibbling on your screen. Sorry about the dead pixels.',
        'I\'m eating your fingers.  Seriously, you should get more of these!',
        'Feed me....'
      ];
      layerClient.messages.sendTextFromName(conversationId, 'Food-bot', messages[Math.floor(Math.random() * 6)]);
    }
  }
function foodTalk (msg, text) {
    var conversationId = msg.conversation.id;

    var matches = text.match(/eat my (.+?)\b/i);
    if (matches) {
      layerClient.messages.sendTextFromName(conversationId, 'Food-bot', 'My ' + matches[1] + ' taste a lot better than yours');
    } else {
      var messages = [
        'I\'m eating yummy carbon',
        'I\'m eating yummy silicon',
        'I\'m eating your keyboard. Yummy!',
        'I\'m nibbling on your screen. Sorry about the dead pixels.',
        'I\'m eating your fingers.  Seriously, you should get more of these!',
        'Feed me....'
      ];
      layerClient.messages.sendTextFromName(conversationId, 'Food-bot', messages[Math.floor(Math.random() * 6)]);
    }
  }
function foodTalk ( msg , text ) { var conversationId = msg . conversation . id ; var matches = text . match ( / eat my (.+?)\b / i ) ; if ( matches ) { layerClient . messages . sendTextFromName ( conversationId , 'Food-bot' , 'My ' + matches [ 1 ] + ' taste a lot better than yours' ) ; } else { var messages = [ 'I\'m eating yummy carbon' , 'I\'m eating yummy silicon' , 'I\'m eating your keyboard. Yummy!' , 'I\'m nibbling on your screen. Sorry about the dead pixels.' , 'I\'m eating your fingers.  Seriously, you should get more of these!' , 'Feed me....' ] ; layerClient . messages . sendTextFromName ( conversationId , 'Food-bot' , messages [ Math . floor ( Math . random ( ) * 6 ) ] ) ; } }
If someone sends any phrase that has the word eat in it, respond with some food talk...
If someone sends any phrase that has the word eat in it respond with some food talk ...