Oct 16 2023 04:30 PM
How do I allow the user to perform the action?
The Action.Execute works as expected in a private chat, but not in a team channel.
This is the relevant part of my app manifest:
"bots": [
{
"botId": REDACTED,
"scopes": [
"personal"
],
"commandLists": [
{
"commands": [
{
"title": "login",
"description": "login to account"
},
{
"title": "logout",
"description": "logout of account"
}
],
"scopes": [
"personal"
]
}
],
"isNotificationOnly": false,
"supportsCalling": false,
"supportsVideo": false,
"supportsFiles": false
}
],
"composeExtensions": [
{
"botId": REDACTED,
"commands": [],
"canUpdateConfiguration": false,
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [REDACTED],
"supportsAnonymizedPayloads": true
}
}
]
}
],
the code to handle the button:
async onAdaptiveCardInvoke(context, invokeValue) {
try {
// The verb "userExecute" is sent from the Adaptive Card defined in adaptiveCards/learn.json
if (invokeValue.action.verb === "userExecute") {
const card = {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.6",
"body": [
{
"type": "TextBlock",
"size": "Default",
"text": "Adaptive Card-based Loop component Successfully Execute!! ",
"style": "heading"
},
{
"type": "Image",
"url": "https://raw.githubusercontent.com/microsoft/botframework-sdk/master/icon.png",
"height": "auto",
"size": "Medium",
"horizontalAlignment": "left",
"spacing": "None",
"width": "0px"
}
]
};
return {
statusCode: 200,
type: "application/vnd.microsoft.card.adaptive",
value: card
};
}
} catch (err) {
console.log('err: ', err);
const error = new VError({ cause: err }, 'unable to catch invoke activity')
throw error
}
}
My actions:
{
type: 'Action.Execute',
title: 'Show Rich Preview',
style: 'positive',
verb: 'showRichPreviewSubmit',
fallback: 'Action.Submit',
},
{
type: 'Action.Execute',
title: 'Dismiss',
verb: 'showRichPreviewDismiss',
fallback: 'Action.Submit',
},
{
type: "Action.Execute",
title: "Execute!",
verb: "userExecute",
fallback: "Action.Submit"
},
]
Oct 16 2023 10:23 PM
Oct 18 2023 05:09 AM
Oct 18 2023 11:06 AM - edited Oct 18 2023 11:23 AM
@Sayali-MSFT Ok I added the teams scope, and I am no longer seeing that error. My manifest now looks like this:
"bots": [
{
"botId": REDACTED,
"scopes": [
"personal",
"team"
],
"commandLists": [
{
"commands": [
{
"title": "login",
"description": "login to account"
},
{
"title": "logout",
"description": "logout of account"
}
],
"scopes": [
"personal"
]
}
],
"isNotificationOnly": false,
"supportsCalling": false,
"supportsVideo": false,
"supportsFiles": false
}
],
"composeExtensions": [
{
"botId": REDACTED,
"commands": [],
"canUpdateConfiguration": false,
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [REDACTED],
"supportsAnonymizedPayloads": false
}
}
]
}
],
Oct 23 2023 09:46 AM
Oct 25 2023 06:02 AM
@jesspoemape -Glad to hear that your issue is resolved.
Could you please share your valuable feedback via Microsoft Teams Developer Feedback link.