Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

botframework

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botframework - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

1

dist/es5/src/bot.d.ts

@@ -9,2 +9,3 @@ import { FacebookServer, FacebookBot } from './facebook';

constructor(settings: IBotSettings, botController: IBotController);
setWelcomeMessage(text: string): void;
}

@@ -14,2 +14,7 @@ "use strict";

}
Bot.prototype.setWelcomeMessage = function (text) {
if (!this.facebookServer)
return;
this.facebookServer.setWelcomeMessage(text);
};
return Bot;

@@ -16,0 +21,0 @@ }());

@@ -7,2 +7,3 @@ import { IBotSettings } from '../interfaces';

constructor(settings: IBotSettings, facebookBot: FacebookBot);
setWelcomeMessage(text: string): void;
private startWebServer();

@@ -9,0 +10,0 @@ private receiveMessage(request, reply);

@@ -18,2 +18,28 @@ "use strict";

}
FacebookServer.prototype.setWelcomeMessage = function (text) {
request.post({
url: BASE_API + "/" + this.settings.fb.page_id + "/thread_settings?access_token=" + this.settings.fb.access_token,
body: {
setting_type: "call_to_actions",
thread_state: "new_thread",
call_to_actions: [
{
message: {
text: text
}
}
]
},
json: true
}, function (err, res, body) {
if (err) {
console.log('could not change fb new thread settings', JSON.stringify(err, null, 2));
throw err;
}
if (res.statusCode >= 400) {
throw new Error("Error connecting to fb " + JSON.stringify(res));
}
console.log('changed fb new thread settings');
});
};
FacebookServer.prototype.startWebServer = function () {

@@ -20,0 +46,0 @@ var server = new hapi_1.Server();

2

package.json
{
"name": "botframework",
"version": "0.11.0",
"version": "0.12.0",
"description": "Framework for messaging bots",

@@ -5,0 +5,0 @@ "main": "./dist/es5/src/bot.js",

@@ -90,2 +90,3 @@ [![Build Status](https://travis-ci.org/amitevski/botframework.svg?branch=master)](https://travis-ci.org/amitevski/botframework)

var bot = new Bot(botSettings, new BotController());
bot.setWelcomeMessage('
```

@@ -92,0 +93,0 @@

@@ -13,2 +13,7 @@ import {FacebookServer, FacebookBot} from './facebook';

}
setWelcomeMessage(text: string) {
if (!this.facebookServer) return;
this.facebookServer.setWelcomeMessage(text);
}
}

@@ -26,2 +26,30 @@ import {IBotSettings} from '../interfaces';

public setWelcomeMessage(text: string) {
request.post(
{
url: `${BASE_API}/${this.settings.fb.page_id}/thread_settings?access_token=${this.settings.fb.access_token}`,
body: {
setting_type:"call_to_actions",
thread_state:"new_thread",
call_to_actions:[
{
message:{
text
}
}
]
},
json: true
}, (err, res, body) => {
if (err) {
console.log('could not change fb new thread settings', JSON.stringify(err, null, 2));
throw err;
}
if (res.statusCode >= 400) {
throw new Error(`Error connecting to fb ${JSON.stringify(res)}`);
}
console.log('changed fb new thread settings');
});
}
private startWebServer() {

@@ -28,0 +56,0 @@ let server = new Server();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc