beginner
Posts: 2
Joined: Sun Nov 14, 2021 2:57 pm

Syn Bot - Oscova WidgetChannel cannot display Hint

Fri Nov 26, 2021 12:58 pm

The Bot can only display the Text but not the Hint after updated Syn.Bot from version 2.9 to to 4.6. Tried to add Dialog or import an Oryzer workplace have the same result... I am a beginner in Syn Bot, can someone give me a hand? Thanks.

CSharp Code

using System;
using System.Web;
using System.Web.UI;
using Syn.Bot.Channels.Widget;
using Syn.Bot.Oscova;
using Syn.Bot.Oscova.Attributes;

namespace BotWebsite
{
    public partial class BotService : Page
    {
        private static WidgetChannel WidgetChannel { get; }
        private static OscovaBot bot { get; }
        static BotService()
        {
            bot = new OscovaBot();
            //bot.ImportWorkspace("");
            WidgetChannel = new WidgetChannel(bot);
            bot.Dialogs.Add(new AppDialog());
            bot.Dialogs.Add(new ProductDialog());

            bot.Trainer.StartTraining();

            var websiteUrl = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);
            WidgetChannel.ServiceUrl = websiteUrl + "/BotService.aspx";
            WidgetChannel.ResourceUrl = websiteUrl + "/BotResources";
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            WidgetChannel.Process(Request, Response);
        }
    }

    public class ProductDialog: Dialog
    {
        [Expression("test")]
        public void test(Result result)
        {
            var response = new Response();
            response.Text = "I was expecting a yes or no answer.";
            response.Hint = "Yes|No";
            result.SendResponse(response);
        }
    }
}

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest