亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

是否有消息“抱歉,似乎出了點問題。” 當我使用收據卡時在 Line 和 Messengers

是否有消息“抱歉,似乎出了點問題。” 當我使用收據卡時在 Line 和 Messengers

C#
ibeautiful 2023-09-16 17:02:23
我創建了一個機器人并使用收據代碼來顯示我的摘要結果。在測試和部署到網絡聊天頻道時沒有出現問題,但是當我將機器人添加到 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);        }
查看完整描述

1 回答

?
慕沐林林

TA貢獻2016條經驗 獲得超9個贊

收據卡在 Messenger 中得到正式支持,但由于通道連接器錯誤而無法工作。我已在內部提交了該錯誤的申請。同時,解決方法是使用 Facebook Messenger 的收據模板并將 Messenger 平臺模板作為渠道數據發送。

在 Node.js 中發送收據卡的簡單示例:

this.onMessage(async context => {

? await context.sendActivity({

? ? channelData: {

? ? ? 'attachment': {

? ? ? ? 'type': 'template',

? ? ? ? 'payload': {

? ? ? ? ? 'template_type': 'receipt',

? ? ? ? ? 'recipient_name': 'Stephane Crozatier',

? ? ? ? ? 'order_number': '12345678902',

? ? ? ? ? 'currency': 'USD',

? ? ? ? ? 'payment_method': 'Visa 2345',? ? ? ??

? ? ? ? ? 'order_url': 'http://petersapparel.parseapp.com/order?order_id=123456',

? ? ? ? ? 'timestamp': '1428444852',? ? ? ? ?

? ? ? ? ? 'address': {

? ? ? ? ? ? 'street_1': '1 Hacker Way',

? ? ? ? ? ? 'street_2': '',

? ? ? ? ? ? 'city': 'Menlo Park',

? ? ? ? ? ? 'postal_code': '94025',

? ? ? ? ? ? 'state': 'CA',

? ? ? ? ? ? 'country': 'US'

? ? ? ? ? },

? ? ? ? ? 'summary': {

? ? ? ? ? ? 'subtotal': 75.00,

? ? ? ? ? ? 'shipping_cost': 4.95,

? ? ? ? ? ? 'total_tax': 6.19,

? ? ? ? ? ? 'total_cost': 56.14

? ? ? ? ? },

? ? ? ? ? 'adjustments': [

? ? ? ? ? ? {

? ? ? ? ? ? ? 'name': 'New Customer Discount',

? ? ? ? ? ? ? 'amount': 20

? ? ? ? ? ? },

? ? ? ? ? ? {

? ? ? ? ? ? ? 'name': '$10 Off Coupon',

? ? ? ? ? ? ? 'amount': 10

? ? ? ? ? ? }

? ? ? ? ? ],

? ? ? ? ? 'elements': [

? ? ? ? ? ? {

? ? ? ? ? ? ? 'title': 'Classic White T-Shirt',

? ? ? ? ? ? ? 'subtitle': '100% Soft and Luxurious Cotton',

? ? ? ? ? ? ? 'quantity': 2,

? ? ? ? ? ? ? 'price': 50,

? ? ? ? ? ? ? 'currency': 'USD',

? ? ? ? ? ? ? 'image_url': 'http://petersapparel.parseapp.com/img/whiteshirt.png'

? ? ? ? ? ? },

? ? ? ? ? ? {

? ? ? ? ? ? ? 'title': 'Classic Gray T-Shirt',

? ? ? ? ? ? ? 'subtitle': '100% Soft and Luxurious Cotton',

? ? ? ? ? ? ? 'quantity': 1,

? ? ? ? ? ? ? 'price': 25,

? ? ? ? ? ? ? 'currency': 'USD',

? ? ? ? ? ? ? 'image_url': 'http://petersapparel.parseapp.com/img/grayshirt.png'

? ? ? ? ? ? }

? ? ? ? ? ]

? ? ? ? }

? ? ? }

? ? }

? });

});

要創建實現 LINE 特定消息類型的消息,請將活動對象的通道數據屬性設置為指定 LINE 消息類型和操作類型的 JSON 對象。這將指導您了解如何使用 LINE 特定消息的 channelData 屬性。


希望這可以幫助。


查看完整回答
反對 回復 2023-09-16
  • 1 回答
  • 0 關注
  • 108 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號