I am trying to build skype bot.
I followed documentation given by skype-sdk
but failed to create it using that. Can not get reply from bot.
const fs = require('fs');
const restify = require('restify');
const skype = require('skype-sdk');
const botService = new skype.BotService({
messaging: {
botId: 'xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx',
serverUrl : "https://example.net",
requestTimeout : 15000,
appId: 'xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx',
appSecret: 'xxxxxxxxxxxxxxxxxxxxxxxx'
}
});
botService.on('contactAdded', (bot, data) => {
console.log("bot replay");
bot.reply('Hello ${data.fromDisplayName}!', true);
});
botService.on('personalMessage', (bot, data) => {
console.log("person replay");
bot.reply('Hey ${data.from}. Thank you for your message: "${data.content}".', true);
});
const server = restify.createServer();
server.use(skype.ensureHttps(true));
server.use(skype.verifySkypeCert({}));
server.post('/skbot', skype.messagingHandler(botService));
const port = process.env.PORT || 8080;
server.listen(port);
console.log('Listening for incoming requests on port ' + port);
Thanks