【问题标题】:Skype bot card images not showing upSkype 机器人卡图像未显示
【发布时间】:2016-08-10 11:32:52
【问题描述】:

我正在发送此帖子请求,并且所有卡片(如缩略图、轮播、英雄)都已显示,但卡片图片未显示。我尝试了很多不同的方法,但都没有奏效。

我正在用 python 创建一个机器人,一切正常,接受这个问题。

这些是我寻找问题的一些链接。但似乎我做的一切都是正确的。有什么帮助吗?

https://docs.botframework.com/en-us/skype/chat/#navtitle

{
'text': 'testinglookssuccessful',
'type': 'message/card.carousel',
'attachments': [{
    'content': {
        'images': [{
            'image': 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Seattlenighttimequeenanne.jpg/320px-Seattlenighttimequeenanne.jpg',
            'alt': 'hello'
        }],
        'text': 'cardtext',
        'buttons': [{
            'type': 'imBack',
            'value': 'testingsuccess',
            'title': 'test1'
        }],
        'subtitle': 'herocardsubtitle',
        'title': 'herocardtest'
    },
    'contentType': 'application/vnd.microsoft.card.hero'
}],
'summary': 'thisismyfirstskypebot'}

这是我通过机器人发送到 Skype 时显示的内容。

screenshot for Skype test bot for hero card

【问题讨论】:

  • 你使用哪个版本的Skype?
  • 我正在使用web.skype.com/en beta 版本来测试最新的 V3 功能。
  • 你能添加几行代码吗?
  • r = requests.post('https://apis.skype.com/v3/conversations/'+sender+'/activities/',headers={"Authorization": "Bearer "+token,"Content-Type":"application/json"},json=payload) 上面的json是payload,sender是id,token是skype令牌
  • 请不要编辑您的问题以在标题中添加“已解决”。相反,将正确答案标记为已接受(一旦可以;有时间限制)。谢谢。

标签: bots botframework skype-bots microsoft-skype-bot


【解决方案1】:

问题已解决:

问题在于https://docs.botframework.com/en-us/skype/chat/#navtitle 文档中错误提及的“图像”键。我用 'url' 键替换了 'image' 键

【讨论】:

    猜你喜欢
    • 2019-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多