Example #1
0
        public async Task Jokes(IDialogContext context, LuisResult result)
        {
            List <String> messagePoll = new List <string>
            {
                "One joke incoming...",
                "I hope this one will make you laugh...",
                "Joke incoming"
            };

            string preMessage = messagePoll.OrderBy(s => Guid.NewGuid()).First();
            await context.PostAsync(preMessage);

            var typingMessage = context.MakeMessage();

            typingMessage.Type = ActivityTypes.Typing;
            await context.PostAsync(typingMessage);



            string message = await DadJokeService.GetJoke();

            await context.PostAsync(message);


            //BotData userData = await context.UserData.Get()

            context.Wait(this.MessageReceived);
        }
Example #2
0
        public ActionResult ByTerm(string term)
        {
            // Get the url for the specific search term
            var jokes = DadJokeService.GetJokes(term);

            //Send list of jokes to view
            return(View(jokes));
        }
Example #3
0
        public ActionResult Random()
        {
            //Get random joke
            Joke joke = DadJokeService.GetJokes();

            //Send the joke to the view
            return(View(joke));
        }
 public DadJokeCommandHandler(TwitchClientServices twitchClient, IMapper mapper, INotifierMediatorService notifierMediatorService, TwitchAPI twitchApiClient, IHubContext <TwitchHub> twitchHub, DadJokeService service, IOptions <TwitchConfig> config)
 {
     _twitchClient            = twitchClient.Client;
     _mapper                  = mapper;
     _notifierMediatorService = notifierMediatorService;
     _twitchApiClient         = twitchApiClient;
     _service                 = service;
     _config                  = config.Value;
 }