1
votes

We have a sideloaded Microsoft Teams bot (called Axel), fully operational and running in production. The bot is able to send messages (including proactive), receive messages, etc.

However, users cannot initiate a conversation with the bot -- the bot MUST send a message first for it to work. I believe this is not expected / desired behavior. When searching for the bot in the search tab, we find it, but when clicking on its name nothing happens.

How can we make it possible for users to initiate conversations with the bot?

Screenshot

Edit: here is our redacted manifest.json file

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

Translation of scopes:

  • Receive messages & data from me
  • Send me messages & notification
  • Access profile info
  • Receive messages & data from users in channels
  • Send messages & notifications in a channel Access team information
1
It is not indeed a normal behaviour : you should check your configuration doc says Team owners and users with the appropriate permissions can also add bots as team members (see Interact in a team channel), which not only makes them available in that team's channels, but for personal chat for all of those users as well.B. Lec
Thanks @B.Lec. I would like to avoid re-publishing as it is an overhead and potentially error-prone for a production app & requires external IT support (in a customer's tenant). I'll try locally and see if it changes anything. To answer 1. Indeed, the bot was added to a team and it IS available to users (users can see the bot and interact with it normally IF the bot has previously messaged them)Konrad
Strange things, will follow this topicNicolas R
If your bot's purpose is to deliver notification to users and is not conversational, you can set the isNotificationOnly field to true in your app manifest else disable it to initiate conversation with your bot. Follow the doc for adding field in app manifest Notification only bots.Trinetra-MSFT

1 Answers

2
votes

Your bot only has the "team" scope enabled.

  1. Open your manifest.json in App Studio.
  2. Go to the Bots section
  3. Click Edit
  4. Enable the Personal scope

enter image description here

Alternatively, you can just add the scope manually, then re-sideload/publish your bot.

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

Also, be sure that you've enabled the Teams Channel by going to:

  1. Azure Portal
  2. Your Resource Group
  3. Your Web App Bot or Bot Channels Registration Service
  4. Channels
  5. Enable the Teams Channel

enter image description here