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

Microsoft Teams Bot - User cannot initiate conversation

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

但是,用户无法发起与机器人的对话——机器人必须先发送消息才能工作。我相信这不是预期/期望的行为。在搜索选项卡中搜索机器人时,我们找到了它,但是当点击它的名字时没有任何反应。

我们如何才能让用户发起与机器人的对话?

编辑:这是我们编辑过的 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}"
    ]
}

范围翻译:

您的机器人只启用了 "team" 作用域。

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

或者,您可以手动添加范围,然后 re-sideload/publish 您的机器人。

{
    "$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}"
    ]
}

此外,请确保您已启用 Teams 频道,方法是:

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