我创建了一个机器人并使用收据代码来显示我的摘要结果。在测试和部署到网络聊天频道时没有出现问题,但是当我将机器人添加到 Line 频道和 Messenger 频道时,我收到此消息“抱歉,看起来出了问题。” 我检查了我的代码,发现问题发生在我使用收据卡时。
我的代码(在ConfirmBookingStepAsync处发出)
namespace Microsoft.BotBuilderSamples
{
public class BookingDataDialog : ComponentDialog
{
private readonly IStatePropertyAccessor<BookingData> _userProfileAccessor;
public BookingDataDialog(UserState userState)
: base(nameof(BookingDataDialog))
{
_userProfileAccessor = userState.CreateProperty<BookingData>("BookingData");
// This array defines how the Waterfall will execute.
var waterfallSteps = new WaterfallStep[]
{
AllowBookingStepAsync,
SelectRoomStepAsync,
EmployeeIdStepAsync,
BookingDateStepAsync,
TimeFromStepAsync,
TimeToStepAsync,
ConfirmBookingStepAsync,
FinalStepAsync
};
// Add named dialogs to the DialogSet. These names are saved in the dialog state.
AddDialog(new WaterfallDialog(nameof(WaterfallDialog), waterfallSteps));
AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
AddDialog(new TextPrompt(nameof(TextPrompt)));
AddDialog(new DateTimePrompt(nameof(DateTimePrompt)));
AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
// The initial child Dialog to run.
InitialDialogId = nameof(WaterfallDialog);
}
慕沐林林
相关分类