Exemple #1
0
        public async Task ResumeAndPromptSummaryAsync(IDialogContext context, IAwaitable <string> argument)
        {
            string topic = await argument;

            AllQuotes m = await Trump.GetAllQuotes();

            var onpoint = m.messages.non_personalized.Where(x => x.Contains(topic)).FirstOrDefault();

            if (onpoint != null)
            {
                PromptDialog.Confirm(
                    context: context,
                    resume: ResumeAndHandleConfirmAsync,
                    prompt: $"Here is one for you, {onpoint}'. Do I have your support?",
                    retry: "I didn't understand. Please try again.");
            }
            else
            {
                string campaignMessage = await Trump.GetRandomQuote();

                PromptDialog.Confirm(
                    context: context,
                    resume: ResumeAndHandleConfirmAsync,
                    prompt: $"Not sure I have one of those but I will give you one anyway. {campaignMessage}'. Do I have your support now?",
                    retry: "I didn't understand. Please try again.");
            }
        }