Exemple #1
0
 /// <summary>
 /// This handle method looks for our main "Keys", those being Canvas, Notes, or Help and directs the user to the specific Controller for further "handling"
 /// </summary>
 /// <param name="text">The input by the user</param>
 /// <returns> a List of Strings which are retrieved from the methods being called which will be sent back to the bot to send to the user </returns>
 public List <string> Handle(string text)
 {
     if (text.Contains("canvas"))
     {
         return(_canvas.CanvasTimeDecider(text));
     }
     else if (text.Contains("todo"))
     {
         return(_notes.NoteTimeDecider(text));
     }
     else if (text.Contains("help"))
     {
         return(_help.Helper(text));
     }
     else
     {
         return(_help.HandlerError(text));
     }
 }
Exemple #2
0
 /// <summary>
 /// Once the bot finds the key word Canvas, it is directed here to decide which time-based method to call
 /// </summary>
 /// <param name="text">The Input from the user</param>
 /// <returns>A List of strings for the bot to spit back to the user</returns>
 public List <string> CanvasTimeDecider(string text)
 {
     if (text.Contains("today"))
     {
         return(Today(text).Result);
     }
     else if (text.Contains("week"))
     {
         return(Week(text).Result);
     }
     else if (text.Contains("upcoming"))
     {
         return(Upcoming(text).Result);
     }
     else
     {
         HelpController _help = new HelpController();
         return(_help.HandlerError(text));
     }
 }