Coder Social home page Coder Social logo

tompaana / twitter-bot-fw-integration Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 5.0 27 KB

A class library with a sample demonstrating how to add Twitter as one of the Microsoft Bot Framework channels with the help of Direct Line API.

License: Other

C# 100.00%
twitter microsoft-bot-framework chatbot

twitter-bot-fw-integration's Issues

Enable multiple bot responses via Direct Line (Was: Why track _twitterUsersWaitingForReply ?)

In the TwitterBotIntegrationManager.cs, ReplyInTwitter method, you send a response and remove the user _twitterUsersWaitingForReply.Remove(messageIdAndTimestamp);

I'm trying to send multiple messages in response to a user's tweet so this will send the first message, but not the 2nd and 3rd as the _twitterUsersWaitingForReply.Remove(messageIdAndTimestamp); has been called.

If I comment this out, my 3 replies get delivered, but I didnt go through all the code to see the significance of the _twitterUsersWaitingForReply List.

Cant we just send a message to a user? Why do we care that they are "awaiting a reply" ?

Not receiving proactive messages

When trying to send proactive messages twitter doesn't show anything, the code I am using is the following:

var userAccount = new ChannelAccount() {Id = activityRecibida.FromId, Name = activityRecibida.FromName};
                var botAccount = new ChannelAccount()
                {
                    Id = activityRecibida.RecipientId,
                    Name = activityRecibida.RecipientName
                };
                string url = activityRecibida.ServiceUrl;

                
                MicrosoftAppCredentials.TrustServiceUrl(url, DateTime.Now.AddYears(2));
                var appId = System.Configuration.ConfigurationManager.AppSettings["MicrosoftAppId"];
                var appPassword = System.Configuration.ConfigurationManager.AppSettings["MicrosoftAppPassword"];
                var account = new MicrosoftAppCredentials(appId, appPassword);
                var connector = new ConnectorClient(new Uri(url), account);

                IMessageActivity activity = Activity.CreateMessageActivity();
                activity.From = botAccount;
                activity.Recipient = userAccount;
                activity.Conversation = new ConversationAccount() {Id = activityRecibida.ConversationId};
                activity.Text = $"[{from}]: " + message;
                activity.Locale = activityRecibida.Local;
                var response = await connector.Conversations.SendToConversationAsync((Activity) activity);
                await activityLogger.LogAsync(activity);

It works on facebook, emulator and skype, but here it simply doesn't. Do you have any clue? Thanks

duplicate messages

Hi,
Sometimes I receive the same response twice, attached to the response of the next iteration.
Other times, the bot simply halts... specially If I use formflows or send many postasync msgs and a context.wait later

Null exception on StartStream

I tried to run this project on a new PC and it throws a null exception on the line 26 in Program.cs, why could it be?

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.