Prerequisites
- Microsoft Application Id, Secret. Click here to get Microsoft Application Id, Secret
- Node JS, NPM Package Manager.
- Public Hosting Service IP/ Domain with supporting NodeJS Applications.
- Skype Bot Id Click here to get Skype Bot Id.
- node --version v4.4.4, npm -version 2.15.1
Step1: Creating the Empty NodeJS Project.
const restify = require('restify');- Create a Directory SkypeBot.
- cd to SkypeBot.
- Create an empty NodeJS Project with 'npm init'.
- npm install restify --save
- npm install botbuilder --save
const skype = require('skype-sdk');
const builder = require('botbuilder');
Note: skype-sdk is not available in npm package manager or you will get empty directory while downloading from npm package manager. download it from here.
Step3: Create and Initialize the Skype BotService with Default Configurations.
const botService = new skype.BotService({
messaging: {
botId: "28:f53d6e20-1e46-4cee-884d-***************",
serverUrl : "https://apis.skype.com",
requestTimeout : 15000,
appId: 'f53d6e20-1e46-4cee-884d-************',
appSecret: 'vFkWqyob2Tvdc**********'
}
});
Step4: Create REST API with Restify Server.
const server = restify.createServer();
Step5: Create Skype Event Handler's.
botService.on('contactAdded', (bot, data) => {
bot.reply(`Hello ${data.fromDisplayName}!`, true);
});
botService.on('personalMessage', (bot, data) => {
bot.reply(`Hey ${data.from}. Thank you for your message: "${data.content}".`, true);
});
Step6: Create Skype POST Method API Call, Skype webhook will trigger with POST method and passing with bot Object & data.
try{
server.post('/v1/chat', skype.messagingHandler(botService));
}catch(err){
console.log(err)
}
Step7: Create a Server listener
server.listen(process.env.PORT || 1328, function () {
console.log('%s listening to %s', "skype bot", "https://bot.zerooneprograms.com/skype/");
//console.log(bot);
});
For Working Sample Click Download here.
Reference:
- http://docs.botframework.com https://developer.microsoft.com/en-us/skype/bots/docs/tutorials/simple-nodejs
- http://docs.pandorabots.com/deployments/browser-integration/https://playground.pandorabots.com/en/bot/test/info/#
- http://docs.pandorabots.com/libraries/aiml-standard-library/
- http://docs.pandorabots.com/
- https://playground.pandorabots.com/en/tutorial/
- https://code.google.com/archive/p/program-ab/
- http://www.alicebot.org/aimlbots.htmlhttp://www.tutorialspoint.com/aiml/aiml_star_tag.htmhttp://stackoverflow.com/questions/9706769/any-tutorials-for-developing-chatbots/9707402#9707402
- http://docs.botframework.com/builder/node/guides/examples/#navtitle
- http://www.programmableweb.com/category/bots/frameworks
- https://docs.google.com/document/d/1wNT25hJRyupcG51aO89UcQEiG-HkXRXusukADpFnDs4/pub
- https://code.google.com/archive/p/aiml-en-us-foundation-alice/downloads