Esempio n. 1
0
        /// <summary>
        /// Create a prompt for feedback comment activity with message text and dismiss action defined by passed FeedbackOptions parameter.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public static Activity GetFeedbackCommentPrompt(ITurnContext context, FeedbackOptions feedbackOptions = null)
        {
            feedbackOptions ??= new FeedbackOptions();
            var choices = new List <Choice> {
                feedbackOptions.DismissAction
            };
            var message = ChoiceFactory.ForChannel(context.Activity.ChannelId, choices, $"{feedbackOptions.FeedbackReceivedMessage},{feedbackOptions.CommentPrompt}");

            return(message as Activity);
        }
Esempio n. 2
0
        /// <summary>
        /// Create a prompt for feedback activity with message text and feedback actions defined by passed FeedbackOptions parameter.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="feedbackOptions"></param>
        /// <returns></returns>
        public static Activity CreateFeedbackActivity(ITurnContext context, FeedbackOptions feedbackOptions = null)
        {
            feedbackOptions ??= new FeedbackOptions();
            var choices = new List <Choice>(feedbackOptions.FeedbackActions)
            {
                feedbackOptions.DismissAction
            };
            var feedbackActivity = ChoiceFactory.ForChannel(context.Activity.ChannelId, choices, feedbackOptions.FeedbackPromptMessage);

            return(feedbackActivity as Activity);
        }