I have tried to integrate a card bot with teams, but bot is not replying also in bot emulator ,while same bot is replying in https://dev.botframework.com/bots/ and bot service of azure.code is same as BotBuilder-Sample inside that cards-Adaptivecards.Only change i have done is
// Create chat bot and listen to messages
var connector = new builder.ChatConnector({
appId: "628d8adc-3196-405d-87f6-d94ebfd3c511",
appPassword: "gqihkQISB5~crWKP5463|}_"
}); harded coded appId and password.
The Bot State API is deprecated. Please refer to aka.ms/I6swrh for details on how to replace with your own storage. And error ocurred Error: GET to 'b23cc4c1.ngrok.io/v3/botstate/emulator/users/default-user'; failed: [402] Payment Required at Request._callback (C:\Users\WittyParrot\Documents\card-adaptive\node_modules\botbuilder\lib\bots\ChatConnector.js:559:46) at Request.self.callback (C:\Users\WittyParrot\Documents\card-adaptive\node_modules\request\request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7)
Manifest:
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.2",
"version": "1.0.0",
"id": "89d4a972-fad6-41ce-9f0f-aaae569cd6ed",
"packageName": "Hotel-finder",
"developer": {
"name": "Lalit",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://www.microsoft.com/privacy",
"termsOfUseUrl": "https://www.microsoft.com/termsofuse"
},
"icons": {
"color": "contoso96x96.png",
"outline": "contoso20x20.png"
},
"name": {
"short": "Hotel App ",
"full": "Hotel finder"
},
"description": {
"short": "hotel finder",
"full": "Bot find hotels"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "628d8adc-3196-405d-87f6-d94ebfd3c511",
"scopes": [
"team",
"personal"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": []
}
Per Adaptive Cards for Bot Developers:
Skype and Microsoft Teams are not yet supported in the current preview, but we're working on it! Please see the Channel Status section below for details.
And:
Microsoft Teams: Full support coming soon
In the meantime, Adaptive Cards will not display in Microsoft Teams. The 402 error sounds like a different issue.
Related
I have an Azure bot that we are using to build a message extension functionality in Microsoft Teams.
Users access it via the conversation feature in team channel. It works by taking a search string entered by a user in the message extension, searching our database for matching entries, and once an entry is selected posting a message into a team channel linking to the resource.
It is working as expected in all environments except for Production, where we see the following behaviour:
Some search strings return the expected ("nothing found") response
But most search strings return a 502 error. The bot's log says "The bot is not part of the conversation roster"
We are sideloading the manifest for the bot and its associated tab app. As far as I can tell, there are no differences in bot or app setup between Production and the other apps we setup (QA, staging, etc)
I've checked the other SO posts and those on the Microsoft PowerUsers forum. They mostly say that the bot needs to be added to Teams in Azure, but this has been done. And it's working for all of our environments except for Production...
This is the manifest. It references the eduMe app already published in AppSource:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
"manifestVersion": "1.11",
"version": "1.1.3",
"id": "28beac77-2765-4248-8a25-02779d7242ca",
"packageName": "com.microsoft.teams.extension",
"developer": {
"name": "eduMe",
"websiteUrl": "https://edume.com",
"privacyUrl": "https://edume.com",
"termsOfUseUrl": "https://edume.com"
},
"icons": {
"color": "resources/edume-hexamark.png",
"outline": "resources/edume-outline-hexamark.png"
},
"name": {
"short": "eduMe Beta_test2",
"full": "eduMe Beta_test2"
},
"description": {
"short": "Giving the deskless workforce seamless access to relevant knowledge",
"full": "Training your workforce doesn't need to be painful. No more clunky authoring tools and dated, desktop based learning. eduMe helps you deliver the training when and where your workforce need it."
},
"accentColor": "#F3F3FF",
"bots": [
{
"botId": "e9aa4df6-ed17-423f-bb7a-5cb1f6f090d7",
"scopes": ["personal", "team", "groupchat"],
"supportsFiles": false,
"isNotificationOnly": true
}
],
"composeExtensions": [
{
"botId": "29b96f25-2032-4fa4-8abd-5ac8f652699f",
"commands": [
{
"id": "searchQuery",
"context": ["compose", "commandBox"],
"description": "Command to search courses.",
"title": "Search",
"type": "query",
"parameters": [
{
"name": "searchQuery",
"title": "Search Query",
"description": "Your search query",
"inputType": "text"
}
]
}
]
}
],
"configurableTabs": [
{
"configurationUrl": "https://edume-ms-teams.herokuapp.com/index.html#/config",
"canUpdateConfiguration": true,
"scopes": ["team", "groupchat"]
}
],
"staticTabs": [
{
"entityId": "index",
"name": "Home",
"contentUrl": "https://edume-ms-teams.herokuapp.com/index.html#/tab",
"websiteUrl": "https://edume-ms-teams.herokuapp.com/index.html#/tab",
"scopes": ["personal"]
}
],
"permissions": ["identity", "messageTeamMembers"],
"validDomains": [
"localhost",
"*.microsoftonline.com",
"*.herokuapp.com",
"*.botframework.com",
"edume.com"
],
"webApplicationInfo": {
"id": "29b96f25-2032-4fa4-8abd-5ac8f652699f",
"resource": "api://edume-ms-teams.herokuapp.com/29b96f25-2032-4fa4-8abd-5ac8f652699f"
}
}
I am creating a Custom Teams App, that simply loads a few webpages:
https://www.itcompany.co.nz
https://itcompany.itclientportal.com/ClientPortal/Login.aspx
Note: ITCOMPANY is just a placeholder so I could create this post publically, I can get it to load the itcompany.co.nz , but all I get is a blank screen when attempting to navigate to the 2nd tab (https://itcompany.itclientportal.com/ClientPortal/Login.aspx).
Note: the ClientPortal is just a login screen, there is no SSO etc.
Not sure what I am doing wrong here, hoping I can get some assistance on what I could be missing.
Note: If I change the URL to: https://www.google.co.nz, it does the same thing (doesn't load). refused to connect error, these URLs were added automatically to the allowed domains list by App Studio.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.0",
"id": "05db8546-1517-4306-8dda-7278e8272226",
"packageName": "com.microsoft.teams.m365lp",
"developer": {
"name": "IT Company Limited",
"websiteUrl": "https://www.itcompany.co.nz",
"privacyUrl": "https://www.itcompany.co.nz",
"termsOfUseUrl": "https://www.itcompany.co.nz",
"mpnId": "CA01101011"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "IT COMPANY",
"full": "At IT COMPANY, we solve your IT problems!"
},
"description": {
"short": "IT COMPANY",
"full": "At IT COMPANY, we solve your IT problems!"
},
"accentColor": "#8B8B8B",
"staticTabs": [
{
"entityId": "201911011330",
"name": "IT COMPANY",
"contentUrl": "https://www.itcompany.co.nz/",
"websiteUrl": "https://www.itcompany.co.nz/",
"scopes": [
"personal"
]
},
{
"entityId": "201911011335",
"name": "IT COMPANY Support Portal",
"contentUrl": "https://itcompany.itclientportal.com/ClientPortal/Login.aspx",
"websiteUrl": "https://itcompany.itclientportal.com/ClientPortal/Login.aspx",
"scopes": [
"personal"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"www.itcompany.co.nz",
"itcompany.itclientportal.com",
"*.itclientportal.com",
"*.login.microsoftonline.com",
"*.sharepoint.com",
"*.sharepoint-df.com",
"spoppe-a.akamaihd.net",
"spoprod-a.akamaihd.net",
"resourceseng.blob.core.windows.net",
"msft.spoppe.com"
]
When you include a custom tab in an app in Teams, that tab is supposed to reference the Teams Javascript SDK. See specifically here:
Additionally, you need to add the Teams JavaScript client SDK to your page, and call microsoftTeams.initialize() after your page loads. Doing so will tell Teams to display your page, give you access to Teams-specific information (for example if the Teams client is running the dark theme), and allow you to take action based on the results.
I'm trying to build a Microsoft Teams connector that I have sideloaded into my team while developing. I've set up a testing config page on S3 and have pointed my app manifest to it. When I click the save button, it stays stuck on the "Setting up your connector" spinner for a while, before saying "Unable to save connector configuration. Please try again."
The Javascript of the config page should be visible through the S3 link above; my app manifest is below. After looking at a few similar questions, you'll note that the contentUrl is included by wildcard in validDomains.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json",
"manifestVersion": "1.7",
"version": "1.0.0",
"id": "0b73c39a-db1d-43eb-81bd-3813bef33713",
"packageName": "<redacted>",
"developer": {
"name": "Developer",
"websiteUrl": "<redacted>",
"privacyUrl": "<redacted>",
"termsOfUseUrl": "<redacted>"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Test",
"full": "Test"
},
"description": {
"short": "Test notifications",
"full": "Test notifications"
},
"accentColor": "#FFFFFF",
"connectors": [
{
"connectorId": "0b73c39a-db1d-43eb-81bd-3813bef33713",
"configurationUrl": "https://wsk-teams-test.s3.amazonaws.com/teams_configure.html",
"scopes": [
"team"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"wsk-teams-test.s3.amazonaws.com",
"<redacted>"
]
}
I'm not able to get any more detailed information when attempting this via the desktop Teams app, but in the browser I see this error in the console:
2020-09-02T23:05:20.879Z Received error from connectors {"seq":1599086774636,"timestamp":1599087920857,"flightSettings":{"Name":"ConnectorFrontEndSettings","AriaSDKToken":"<redacted>","SPAEnabled":true,"ClassificationFilterEnabled":true,"ClientRoutingEnabled":true,"EnableYammerGroupOption":true,"EnableFadeMessage":false,"EnableDomainBasedOwaConnectorList":false,"EnableDomainBasedTeamsConnectorList":false,"DevPortalSPAEnabled":true,"ShowHomeNavigationButtonOnConfigurationPage":false,"DisableConnectToO365InlineDeleteFeedbackPage":true},"status":500,"clientType":"SkypeSpaces","connectorType":"0b73c39a-db1d-43eb-81bd-3813bef33713","name":"handleMessageError"}
Thanks for any guidance you might have. If I can get in touch with someone from Microsoft privately, I'd be happy to provide the <redacted> information.
This issue is fixed by adding the content url in valid domains list in the Connector Developer Dashboard.
As recommended above: This issue is fixed by adding the content url in a valid domains list in the Connector Developer Dashboard.
This helped me understand the direction of the problem.
But my accidental mistake was due to the lack of the prefix https://
Be sure to add https:// prefix to your domain
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?
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}"
]
}
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
Your bot only has the "team" scope enabled.
Open your manifest.json in App Studio.
Go to the Bots section
Click Edit
Enable the Personal scope
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:
Azure Portal
Your Resource Group
Your Web App Bot or Bot Channels Registration Service
Channels
Enable the Teams Channel
I have a bot built using ms bot v3 nodejs sdk. I add this bot in my MS team by using deep link for 1:1 conversation which looks like as follows
https://teams.microsoft.com/l/chat/0/0?users=28:{BotID}
I would like to add #mentioning users capability to this bot and I was trying to see if I can get some examples on how to it ?
Not sure if side loading bot as an app will allow it.
Bots and users can only at-mention members of the same conversation.
In a channel, you can mention any user in the team
In a 1:1 chat, you can at-mention the other user
In a group chat, you can mention any user in the chat
Right now neither bots nor users can at-mention arbitrary users who are not members of the conversation.
Your example above, "Hello #PersonB and #PersonC please take care of this ticket", can work if PersonB and PersonC are part of the team (if this in channel), or the group chat, but not in a 1:1 chat with the bot.
The deeplink in your question creates a 1:1 chat w/ the bot, so no other users could be at-mentioned :(
Bots in single user conversations do not require an # mention - the user can just type the command. Bots in channel conversations require the user to # mention the bot to invoke it in a channel.
In order to access your bot into channel, you need to add teams scope to your bot in App Manifest. Please use Teams App Studio to create your app manifest. You need to Upload an app package to Microsoft Teams to see your app.
You can upload your bot as a app, for that you need to create an app manifest in JSON format like this.
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.3.0-beta.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.3",
"version": "1.3",
"id": "c9edb618-c5de-4be2-**f4-74c1*******1",
"packageName": "com.example.tcafebot",
"developer": {
"name": "Harsh Raj",
"websiteUrl": "https://www.sdharshraj.github.io",
"privacyUrl": "https://privacy.microsoft.com/en-us/privacystatement",
"termsOfUseUrl": "https://www.botframework.com/Content/Microsoft-Bot-Framework-Preview-Online-Services-Agreement.htm"
},
"name": {
"short": "TCafeBot",
"full": "Tea and Coffee bot"
},
"description": {
"short": "TCafeBot - a bot helping you with twiter.",
"full": "It will help you find a user or tweets from twiter. Also it can read text from image or even it can tell what is there in a photo."
},
"icons": {
"outline": "bot_blue.png",
"color": "bot_blue.png"
},
"accentColor": "#0079bf",
"configurableTabs": [{
"configurationUrl": "https://contoso.com/teamstab/configure",
"canUpdateConfiguration": true,
"scopes": [
"team",
"groupchat"
]
}],
"staticTabs": [{
"contentUrl": "https://harshcognitivebot.azurewebsites.net/loading",
"entityId": "1on1test123",
"name": "Bot Info",
"scopes": [
"team",
"personal"
]
},
{
"contentUrl": "https://harshcognitivebot.azurewebsites.net/tab-auth/simple",
"entityId": "simpleAuth",
"name": "Simple Auth",
"scopes": [
"personal"
]
},
{
"contentUrl": "https://harshcognitivebot.azurewebsites.net/tab-auth/silent",
"entityId": "silentAuth",
"name": "Silent Auth",
"scopes": [
"personal"
]
}
],
"bots": [{
"botId": "c9edb618-c5de-4be2-**f4-74c1*******1",
"scopes": [
"team",
"personal",
"groupchat"
],
"commandLists": [{
"scopes": [
"team"
],
"commands": [{
"title": "hello",
"description": "Runs the simplest hello dialog"
}
]
},
{
"scopes": [
"personal"
],
"commands": [{
"title": "hello",
"description": "Runs the simplest hello dialog"
}
]
}
]
}],
"composeExtensions": [{
"botId": "c9edb618-c5de-4be2-**f4-74c1*******1",
"canUpdateConfiguration": true,
"commands": [{
"id": "search123",
"description": "Find a card",
"title": "Search",
"initialRun": true,
"parameters": [{
"title": "query123",
"name": "query",
"description": "Search string"
}]
}]
}],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"787c30bb.ngrok.io"
]
}
And also keep a icon with the name given in the Manifest file.
Then you need to make a zip file of these two files(Manifest and Icon). Note that these two file should not be in any folder you should make a zip directly with the two files.
Then Go to Team App and select upload a custom app there you can browse your zip file.
Also for fetching team details you can refer this Link
To use #mention, add your bot to a Teams channel:
Use Teams App Studio to create an App Manifest zip file. Details here.
Upload the App Manifest zip file to the Teams channel. Go to the Teams channel -> Manage Team -> Apps -> Upload a Custom App link (at the bottom)
Your bot is now available in the channel, and users can talk to it using #mention.
Important tip for bots in Teams - Remove the #mention once the text is received by the Bot (in MessageController.cs), before it is sent to LUIS etc
if (activity.ChannelId == ChannelIds.Msteams)
{
//remove bot #mention
if (activity.Text.Contains("<at>"))
{
activity.Text = Regex.Replace(activity.Text, "<at>.*</at>", "", RegexOptions.IgnoreCase).Trim();
}
}