将 Syn.Bot 从 2.9 版本更新到 4.6 后,Bot 只能显示 Text 而不能显示 Hint。尝试添加 Dialog 或导入 Oryzer 工作场所具有相同的结果...我是 Syn Bot 的初学者,有人可以帮帮我吗?谢谢。
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);
}
}
}