All Projects → tompaana → twitter-bot-fw-integration

tompaana / twitter-bot-fw-integration

Licence: other
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.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to twitter-bot-fw-integration

flow-bot
Framework to make bots based on Microsoft Bot Framework.
Stars: ✭ 14 (-12.5%)
Mutual labels:  microsoft-bot-framework
BotBuilder.Standard
An unofficial CoreCLR targeted .NET Standard ported version of BotBuilder.
Stars: ✭ 22 (+37.5%)
Mutual labels:  microsoft-bot-framework
DirectLineAndroidSample
Android Sample for Direct Line API - Microsoft Bot Framework
Stars: ✭ 21 (+31.25%)
Mutual labels:  microsoft-bot-framework
msbotbuilder-go
Microsoft Bot Framework SDK for Go
Stars: ✭ 113 (+606.25%)
Mutual labels:  microsoft-bot-framework
CodeConversations
Code Conversations was a Demo is Scott Hanselman's keynote at Microsoft BUILD 2020. Code Conversations was designed with one goal in mind - to see if we could bring the power of .NET Interactive into Microsoft Teams, to create a way for people to have collaborative conversations about small bits of code.
Stars: ✭ 109 (+581.25%)
Mutual labels:  microsoft-bot-framework
Botkit
Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
Stars: ✭ 10,555 (+65868.75%)
Mutual labels:  microsoft-bot-framework
Holobot
HoloBot is a reusable 3D interface that allows HoloLens & VR users to interact with any bot using Mixed Reality & Speech.
Stars: ✭ 114 (+612.5%)
Mutual labels:  microsoft-bot-framework
Botpress
🤖 Dev tools to reliably understand text and automate conversations. Built-in NLU. Connect & deploy on any messaging channel (Slack, MS Teams, website, Telegram, etc).
Stars: ✭ 9,486 (+59187.5%)
Mutual labels:  microsoft-bot-framework
Botframework Sdk
Bot Framework provides the most comprehensive experience for building conversation applications.
Stars: ✭ 6,673 (+41606.25%)
Mutual labels:  microsoft-bot-framework
Botframework Emulator
A desktop application that allows users to locally test and debug chat bots built with the Bot Framework SDK.
Stars: ✭ 1,532 (+9475%)
Mutual labels:  microsoft-bot-framework
hands-on-bots-node
Repositório responsável pelas vídeo aulas inerentes a nova série do canal: Hands on
Stars: ✭ 32 (+100%)
Mutual labels:  microsoft-bot-framework
bot-message-routing
Message routing component for chatbots built with Microsoft Bot Framework C# SDK.
Stars: ✭ 53 (+231.25%)
Mutual labels:  microsoft-bot-framework
Microsoft-chatbot
Microsoft chatbot build using NLTK-Chatbot and django
Stars: ✭ 34 (+112.5%)
Mutual labels:  microsoft-bot-framework
Viber-and-the-Microsoft-Bot-Framework
se02035.github.io/viber-and-the-microsoft-bot-framework/
Stars: ✭ 16 (+0%)
Mutual labels:  microsoft-bot-framework
CotacaoMonetariaBot
Chatbot para cotação de algumas moedas estrangeiras para o Real (BRL).
Stars: ✭ 27 (+68.75%)
Mutual labels:  microsoft-bot-framework

Twitter - Bot Framework Integration

Running and testing the sample

Prerequisites

The assumption here is that you already have a bot created. If not, go to the Bot Framework developer portal to learn how to create one. Note that you need to have Direct Line enabled and you will need the Direct Line secret.

  • You need to have a Twitter account. If you don't have one, sign up at twitter.com

  • Create a Twitter app:

    1. Navigate to the Twitter Application Management portal
    2. Select Create New App
    3. Fill in the details and click Create your Twitter application
    4. Once your application is created, navigate to the Permissions tab, select Read, Write and Access direct messages and click Update Settings
    5. Navigate to the Keys and Access Tokens tab
      • Since we changed the permissions, we need to regenerate the secrets - so click Regenerate Consumer Key and Secret
      • Under Token Actions click Create my access token
      • Now collect the following credentials (we will need these later):
        • Consumer Key (API key)
        • Consumer Secret (API Secret)
        • Access Token
        • Access Token Secret

Running the solution

Now you should have the following details at hand:

  • Bot Framework
    • Direct Line secret
  • Twitter
    • Consumer Key (API key)
    • Consumer Secret (API Secret)
    • Access Token
    • Access Token Secret
  1. Open the solution (TwitterBotSample.sln) in Visual Studio, locate the Secrets.config file and insert the aforementioned keys and secrets there.

    <appSettings>
      <add key="directLineSecret" value="BOT DIRECT LINE SECRET HERE" />
      <add key="consumerKey" value="TWITTER CONSUMER KEY HERE" />
      <add key="consumerSecret" value="TWITTER CONSUMER SECRET HERE" />
      <add key="accessToken" value="TWITTER ACCESS TOKEN HERE" />
      <add key="accessTokenSecret" value="TWITTER ACCESS TOKEN SECRET HERE" />
    </appSettings>
  2. Run the solution (make sure that TwitterBotSample is set as the start-up project).

  3. While the solution is running, send a Direct Message in Twitter to the Twitter user/account associated with your Twitter app.

  4. That's it! You should now be receiving replies from your bot.

Class library implementation

The class library (here) consists of three main classes:

Usage

TwitterBotIntegrationManager twitterBotIntegrationManager = new TwitterBotIntegrationManager(
    directLineSecret, consumerKey, consumerSecret, accessToken, accessTokenSecret);

twitterBotIntegrationManager.Start();

Remember to dispose the object after it is no longer needed:

twitterBotIntegrationManager.Dispose();

This can be also replaced with using statement that takes care of disposing the object after the scope of the statement ends.

See Program.cs of the sample.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].