2016-07-22 14 views
2

我正在研究bot框架技術,在其中一個項目中,我實現了Hero卡和縮略圖卡的代碼。如何解決在Skype頻道中顯示英雄卡和表格流的問題?

在我添加了上述概念的代碼之後,接下來我在Bot Framework Channel Emulator中測試了它的工作正常併成功顯示了Hero卡。但是,當我將我的代碼發佈到azure並將Skype通道添加到我的機器人後,現在我開始與我的機器人聊天以顯示英雄卡圖像,但它不顯示任何英雄卡圖像,它顯示在下面的屏幕截圖中。 enter image description here

同樣我實現了表格流概念它在Bot模擬器中工作正常,但它不工作在Skype的頻道它的顯示相同的問題,如上圖。

請告訴如何解決此問題。 我認爲Skype中可能存在一個缺陷,顯示Hero Card和Form Flow對話框。

Pradeep

回答

7

這不是Skype中的錯誤,而是缺少的功能。正常的Skype客戶端(桌面,網絡,手機)還沒有更新,以包括HeroCards,所以他們不能被顯示,除了iOS的(請參閱http://blogs.skype.com/2016/07/20/skype-6-20-for-ios-find-bots-improved-notifications-and-chat/

正如在botbuilder項目,暗示你可以使用{listStyle: builder.ListStyle["inline"]}作爲解決方法將您的內容顯示爲選項列表而不是卡片。請參閱:https://github.com/Microsoft/BotBuilder/issues/720。否則你現在所能做的只是安裝包含該功能的開發人員版本或等待更新版本(即將推出)。

+0

感謝您的回覆,我破壞我的頭想這是有些問題,我的代碼。 – Ajit

+0

此答案的任何更新?截至目前,英雄卡也不會在Skype中顯示。 –

+0

這已經由Skype支持。卡片效果很好,你可以在示例https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/cards-RichCards中看到。 –

0

它的工作原理。 Skype是另一個頻道。在大多數情況下,使用bot框架開發的代碼將在Skype上運行,一些功能需要特定於Skype。所以爲了讓你的卡工作,你將不得不通過skype替換botbuilder。見下面的例子是從Microsoft hero card拍攝和修改Skype的工作 skype hero card result

Replace builder by skype 
 
//var builder = require('botbuilder'); 
 

 
var skype = require('botbuilder'); 
 

 
var msg = new skype.Message(session); 
 
    msg.attachmentLayout(skype.AttachmentLayout.carousel) 
 
    msg.attachments([ 
 
     new skype.HeroCard(session) 
 
      .title("Classic White T-Shirt") 
 
      .subtitle("100% Soft and Luxurious Cotton") 
 
      .text("Price is $25 and carried in sizes (S, M, L, and XL)") 
 
      .images([skype.CardImage.create(session, 'https://avatars1.githubusercontent.com/u/6422482?v=4&s=460')]) 
 
      .buttons([ 
 
       skype.CardAction.imBack(session, "buy classic white t-shirt", "Buy") 
 
      ]), 
 
     new skype.HeroCard(session) 
 
      .title("Classic Gray T-Shirt") 
 
      .subtitle("100% Soft and Luxurious Cotton") 
 
      .text("Price is $25 and carried in sizes (S, M, L, and XL)") 
 
      .images([skype.CardImage.create(session, 'https://avatars1.githubusercontent.com/u/6422482?v=4&s=460')]) 
 
      .buttons([ 
 
       skype.CardAction.imBack(session, "buy classic gray t-shirt", "Buy") 
 
      ]) 
 
    ]); 
 
    session.send(msg);

相關問題