code: private String getPatternFromEventType(Event event) {
          switch (event.getType()) {
              case MESSAGE:
                  return event.getMessage().getText();
              case QUICK_REPLY:
                  return event.getMessage().getQuickReply().getPayload();
              case POSTBACK:
                  return event.getPostback().getPayload();
              default:
                  return event.getMessage().getText();
          }
      }
docs: Match the pattern with different attributes based on the event type.
  
  @param event received from facebook
  @return the pattern string