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

prg-chatbot

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prg-chatbot - npm Package Compare versions

Comparing version 0.10.1 to 0.10.2

2

package.json
{
"name": "prg-chatbot",
"version": "0.10.1",
"version": "0.10.2",
"description": "Facebook Messenger Chatbot Framework",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -159,3 +159,3 @@ /*

} else {
this.options.log.warn('Bot received bad message', message);
this.options.log.warn('Bot received bad message', { message, pageId });
return Promise.resolve(null);

@@ -176,3 +176,3 @@ }

return this._loadState(isRef, senderId, pageId)
return this._loadState(isRef, senderId)
.then(stateObject =>

@@ -222,9 +222,13 @@ this._ensureUserProfileLoaded(isRef, senderId, pageId, stateObject))

if (!refHandler.called) {
throw new Error('Call any send method, when optin is received!');
this.options.log.warn('No text message was sent, when optin arrived!', { message, pageId });
return null;
}
return refHandler.promise()
.then(recipientId => this._loadState(false, recipientId, pageId));
.then(recipientId => this._loadState(false, recipientId));
})
.then((stateObject) => {
if (!stateObject) {
return null;
}
Object.assign(stateObject, {

@@ -288,3 +292,3 @@ state,

_loadState (isRef, senderId, pageId) {
_loadState (isRef, senderId) {
if (isRef) {

@@ -306,3 +310,3 @@ return Promise.resolve({

this._model(senderId, pageId)
this._model(senderId)
.then(onLoad)

@@ -323,5 +327,5 @@ .catch(reject);

_model (senderId, pageId) {
_model (senderId) {
const { timeout, defaultState } = this.options;
return this.stateStorage.getOrCreateAndLock(senderId, defaultState, timeout, pageId)
return this.stateStorage.getOrCreateAndLock(senderId, defaultState, timeout)
.catch((err) => {

@@ -328,0 +332,0 @@ if (!err || err.code !== 11000) {

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