Botkit for Microsoft Teams

Sign Up for Free View on Github

The leading developer tool for building chat bots, apps and custom integrations now comes with support for Microsoft Teams.

Build bots that work alongside your team, and use all of Microsoft's cool features like tab applications, compose extensions, and rich cards.

We love bots, and want to make them easy and fun to build!

Watch as a custom bot goes from zero-to-live in just 3 minutes!

Botkit Code Basics

Here's (almost) everything you need to know to build a bot

var Botkit = require('botkit');

var controller = Botkit.teamsbot({
  clientId: process.env.clientId,
  clientSecret: process.env.clientSecret,
  studio_token: process.env.studio_token,
});

Include Botkit into your Node application and boot up a controller that will define your bot's behaviors, and connect it to Microsoft Teams.

controller.setupWebserver(process.env.port,function(err,webserver) {
    controller.createWebhookEndpoints(controller.webserver);
});

Set up a simple webserver so that Botkit can receive incoming messages via webhook.

controller.hears('hello','direct_mention,direct_message', function(bot, message) {

  bot.reply(message,'Howdy!');

});

Tell the bot to listen for users saying "hello," and use `bot.reply` to send an immediate response.

controller.hears('tacos','direct_mention,direct_message', function(bot, message) {

  bot.startConversation(message, function(err, convo) {
    convo.say('Oh boy, taco time!');
    convo.ask('What type of taco do you want?', function(answer, convo) {
      var taco_type = answer.text;
      // do something with this answer!
      // storeTacoType(convo.context.user, taco_type);
      convo.say('YUMMMM!!!'); // add another reply
      convo.next(); // continue with conversation
    });
  });
});

Start a conversation, then queue up multiple messages to send, including a prompt sent using `convo.ask()` which allows your bot to capture user input and use it.

Botkit Community Resources

Join the open Slack at community.botkit.ai

You can join nearly 5,000 developers building bots and messaging apps in our friendly, open Slack community. Sign up today and be sure to introduce yourself in the #botkit channel. Also, expect a DM from our friendly Welcomebot when you join!

Explore Botkit on GitHub and become a contributor

You can contribute to the best botmaking toolkit around! If you need it, you can get help from the thousands of developers building with Botkit. Please browse the GitHub Issues to see known issues and submit any bugs you find, and we'll be sure to help sort them out!

Talkabot

Talkabot is where we explore the past, present and future of bots with other developers and bot enthusiasts. Check out Talkabot.ai for info on upcoming events, and RSVP for one of our local meetups on Meetup. See you there!