How to Implement
Development
First of all, if you don't know how to build a bot with Microsoft Bot Framework (NodeJS), you can check the documentation.
Also there are lots of samples about Microsoft Bot Framework on their Github Repository.
Implementation
Let's go step by step.
- You need to install our nodejs package to your project
npm install monosay
- You must create a bot on our platform
Create a Bot (If you already have a bot skip this step.)
- You must create a channel to connect with
If you already have your token just skip this step
- Go to your bot
- Click channels
- Create Your Channel
- Copy Your Token
Keep your token for next step.
- Import the library
var restify = require('restify');
var builder = require('botbuilder');
// ...
var monosay = require('monosay').usebotframework("YOUR_MONOSAY_TOKEN");
// ...
- Initialize the library
// ...
var bot = new builder.UniversalBot(connector, function(session) {
session.send("You said: %s", session.message.text);
});
// ...
// Initialize the library
monosay.init(bot);
// ...
- Set the session storage (optional but highly recommended)
It is required for persistent user state.
// ...
// ...
// Set the storage
bot.set("storage", monosay.storage());
// ...
monosay.init(bot);
// ...
- Start messaging with your bot.
- Go to your bot's dashboard
- You will start to see your Analytics, Conversations and more...
Congratulations! You have finally implemented {mono}say into your Bot.