Comments (4)
Hi @nouman937,
Let's try to isolate this issue to find the root cause of this problem.
Is this issue reproducible without omnichannel?
from botframework-sdk.
from botframework-sdk.
Hi @nouman937, I can look into this.
from botframework-sdk.
Hi @nouman937,
I isolated this issue from omnichannel and was not able to repro. The OnMessageActivityAsync
handler successfully gets triggered when a user selects an option from adaptive card in Facebook.
I modified the 02.echo-bot sample to send the adaptive card like this:
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var receivedText = turnContext.Activity.Text?.ToLower();
if (receivedText == "card")
{
await SendAdaptiveCardAsync(turnContext, cancellationToken);
}
else
{
var replyText = $"Echo: {turnContext.Activity.Text}";
await turnContext.SendActivityAsync(MessageFactory.Text(replyText, replyText), cancellationToken);
}
}
private async Task SendAdaptiveCardAsync(ITurnContext turnContext, CancellationToken cancellationToken)
{
var card = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0))
{
Actions = new List<AdaptiveAction>
{
new AdaptiveSubmitAction
{
Title = "Option 1",
Data = "option1"
},
new AdaptiveSubmitAction
{
Title = "Option 2",
Data = "option2"
}
}
};
var attachment = new Attachment
{
ContentType = AdaptiveCard.ContentType,
Content = JObject.FromObject(card)
};
var response = MessageFactory.Attachment(attachment);
await turnContext.SendActivityAsync(response, cancellationToken);
}
Demo:
Screen.Recording.2024-02-09.at.3.38.27.PM.mov
Documentation followed:
https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-facebook?view=azure-bot-service-4.0&tabs=messenger
Attached is the tested bot sample:
02.echo-bot.zip
from botframework-sdk.
Related Issues (20)
- FAQ bot is not responding to question asked. Giving 500 error. HOT 2
- Unable to call bot service when we've enabled NGNIX & Fortigate for appservice in azure portal HOT 1
- 404 Not found when trying to use Teams SSO to get the user token HOT 7
- In Microsoft Teams, <Conversation>.ReplyToActivity does not send a reply, it creates a new message to the conversation HOT 4
- Play Continuous Video Stream on the Bot
- SendAdaptiveCards does not work with generic objects HOT 3
- Skype mentions showing "未知用户" HOT 2
- Token Service returning 404 on GetToken when using Keycloak, works with ADv2 HOT 1
- Token Service doesn't refresh the user token HOT 3
- Bot gives same response multiple times when deployed with azure bot service HOT 1
- [Bug] Bot has no response in chat after deploying to non-Testing environment and uploading to Teams HOT 6
- Token Service giving a static dark page when clicking the sign in button multiple times
- [Bot Portal] I can't see my bots HOT 1
- OAuth Provider Model for Azure ARM Template (Azure AD B2C) HOT 1
- [OnTurnError] unhandled error : The CancellationTokenSource has been disposed. HOT 1
- Neither `tid` nor `tenantId` claim is present in the token
- Suggested actions not working properly with choice action.
- Robot
- How can i @ everyone with the framework in sending a message as a bot? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botframework-sdk.