question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] [twitter adapter] Adapter doesn't work on chatbots with QnA Service

See original GitHub issue

It 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
garyprettycommented, Sep 6, 2019

@fercom A new set of NuGet packages should now be available!

1reaction
garyprettycommented, Sep 6, 2019

@fercom Sorry! I didn’t get chance to push it out. Doing it now. Should be available within 30 minutes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found