[bug] [twitter adapter] Adapter doesn't work on chatbots with QnA Service
See original GitHub issueIt looks like QnA Service generates a “trace” type Activity, the adapter detects that the activity doesn’t have text and throws an argument exception. Maybe it needs to filter by activity type on this method on TwitterAdapter.cs?
public override async Task<ResourceResponse[]> SendActivitiesAsync(ITurnContext turnContext,
Activity[] activities, CancellationToken cancellationToken)
{
var responses = new List<ResourceResponse>();
foreach (var activity in activities)
{
await _sender.SendAsync(long.Parse(activity.Recipient.Id), activity.Text,
activity.SuggestedActions?.Actions?.Select(x => x.Title).ToList());
responses.Add(new ResourceResponse(activity.Id));
}
return responses.ToArray();
}
like this:
public override async Task<ResourceResponse[]> SendActivitiesAsync(ITurnContext turnContext,
Activity[] activities, CancellationToken cancellationToken)
{
var responses = new List<ResourceResponse>();
foreach (var activity in activities.Where(a => a.Type == ActivityTypes.Message))
{
await _sender.SendAsync(long.Parse(activity.Recipient.Id), activity.Text,
activity.SuggestedActions?.Actions?.Select(x => x.Title).ToList());
responses.Add(new ResourceResponse(activity.Id));
}
return responses.ToArray();
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Python chatbot default response is not working properly
Hi I am reusing a code of chat bot which I found from internet in python. It basically uses 3 logic adapters. Mathematical,...
Read more >Handle user interruptions - Bot Service
Learn how bots handle user interruptions. See how to implement help and cancel interruptions, how to create and test bots, and how to...
Read more >Configure a bot to run on one or more channels
The service or an adapter translates communication between the Bot Framework Activity schema and the channel's schema. If the channel doesn't ...
Read more >How to plan and analyse a Twitter chatbot
Twitter's how to plan and analyse a Twitter chatbot guide. We look at whether you should build one in-house or bring in a...
Read more >Best framework for checkout bot. NET languages. Learn more ...
Delivery Time 15 Expertise in Django and Django REST framework/DRF NGINX, gunicorn, uWSGI Docker, Docker Compose This Bot uses the Bot Connector Service...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@fercom A new set of NuGet packages should now be available!
@fercom Sorry! I didn’t get chance to push it out. Doing it now. Should be available within 30 minutes.