Ejemplo n.º 1
0
 /// <summary>
 /// If messages corresponds to any of the alread defined payloads, set the payload
 /// </summary>
 /// <param name="message"></param>
 /// <returns></returns>
 public Messaging MessageRecognized(Messaging message)
 {
     try
     {
         if (string.IsNullOrWhiteSpace(message?.postback?.payload) && !string.IsNullOrWhiteSpace(message?.message?.text))
         {
             Console.WriteLine("Zoeken naar payload");
             string response = FreeTextHandler.GetPayload(message.message.text);
             if (response != null)
             {
                 SetPayload(message, response);
             }
         }
         return(message);
     }catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(null);
     }
 }