Microsoft Teams Bot-用户无法发起对话

时间:2019-07-18 09:05:03

标签: botframework microsoft-teams

我们有一个侧面加载的Microsoft Teams机器人(称为Axel),可以完全运行并在生产中运行。该机器人可以发送消息(包括主动消息),接收消息等。

但是,用户无法发起与机器人的对话-机器人必须首先发送一条消息才能使其正常工作。我相信这不是预期的/期望的行为。当在搜索选项卡中搜索该机器人时,我们会找到它,但是单击其名称则什么也没发生。

我们如何使用户能够与机器人进行对话?

Screenshot

编辑:这是我们编辑的manifest.json文件

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json",
    "manifestVersion": "1.3",
    "version": "1.0.0",
    "id": "{app_id}",
    "packageName": "com.package.name",
    "developer": {
        "name": "HeyAxel",
        "websiteUrl": "https://heyaxel.com",
        "privacyUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf",
        "termsOfUseUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf"
    },
    "icons": {
        "color": "color.png",
        "outline": "outline.png"
    },
    "name": {
        "short": "Axel",
        "full": "Axel"
    },
    "description": {
        "short": "shortdesc",
        "full": "fulldesc"
    },
    "accentColor": "#F9F9FA",
    "bots": [
        {
            "botId": "{bot_id}",
            "scopes": [
                "team"
            ],
            "supportsFiles": true,
            "isNotificationOnly": false
        }
    ],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": [
        "{domain1}",
        "{domain2}"
    ]
}

The bot in the Teams > Apps tab

Scopes & permissions displayed to users

范围的翻译:

  • 接收我的消息和数据
  • 向我发送消息和通知
  • 访问个人资料信息
  • 从频道中的用户接收消息和数据
  • 在频道访问小组信息中发送消息和通知

1 个答案:

答案 0 :(得分:0)

您的漫游器仅启用了“团队”作用域。

  1. 在App Studio中打开您的manifest.json
  2. 转到“机器人”部分
  3. 点击修改
  4. 启用个人范围

enter image description here

或者,您可以手动添加范围,然后重新加载/发布您的机器人。

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json",
    "manifestVersion": "1.3",
    "version": "1.0.0",
    "id": "{app_id}",
    "packageName": "com.package.name",
    "developer": {
        "name": "HeyAxel",
        "websiteUrl": "https://heyaxel.com",
        "privacyUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf",
        "termsOfUseUrl": "https://www.heyaxel.com/files/Privacy_Policy.pdf"
    },
    "icons": {
        "color": "color.png",
        "outline": "outline.png"
    },
    "name": {
        "short": "Axel",
        "full": "Axel"
    },
    "description": {
        "short": "shortdesc",
        "full": "fulldesc"
    },
    "accentColor": "#F9F9FA",
    "bots": [
        {
            "botId": "{bot_id}",
            "scopes": [
                "team",
                "personal",
                "groupchat"
            ],
            "supportsFiles": true,
            "isNotificationOnly": false
        }
    ],
    "permissions": [
        "identity",
        "messageTeamMembers"
    ],
    "validDomains": [
        "{domain1}",
        "{domain2}"
    ]
}

此外,请确保通过以下步骤启用了团队频道:

  1. Azure门户网站
  2. 您的资源组
  3. 您的Web App Bot或Bot频道注册服务
  4. 频道
  5. 启用团队频道

enter image description here