var Botkit = require('botkit');
var controller = new Botkit({
});
Include Botkit into your Node application and boot up a controller that will define your bot's behaviors. In this case, we're setting up a bot to use with the Bot Framework Emulator.
controller.hears('hello','message', async (bot, message) => {
await bot.reply(message,'Howdy!');
});
Tell the bot to listen for users saying "hello," and use `bot.reply` to send an immediate response.
const tacos = new BotkitConversation('tacos', controller);
tacos.say('Oh boy, taco time!');
tacos.ask('What type of taco do you want?', async(answer, convo, bot) => {
// do something with the answer!
}, 'type_of_taco');
tacos.say('Yum!!');
controller.addDialog(tacos);
controller.hears('tacos','message', async (bot, message) => {
await bot.beginDialog('tacos');
});
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.
You can join nearly 10,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!
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!
Botkit is just one part of a bigger set of developer tools and SDKs that encompass the Microsoft Bot Framework. The Bot Framework SDK provides the base upon which Botkit is built. It is available in multiple programming languages!