fraight-bot-client
Advanced tools
Comparing version 0.2.3 to 0.2.4
13
index.js
@@ -25,3 +25,4 @@ const express = require('express'); | ||
headers: this.headers, | ||
delay: this.params.delay | ||
delay: this.params.delay, | ||
app: this.app, | ||
}); | ||
@@ -50,2 +51,8 @@ next(); | ||
get promiseForReply() { | ||
new Promise((resolve, reject) => { | ||
this.on('reply', resolve); | ||
}) | ||
} | ||
on(name, cb) { | ||
@@ -103,3 +110,3 @@ this.app.on(name, cb); | ||
class BotThread { | ||
constructor({ botThread, message, headers, host, delay }) { | ||
constructor({ botThread, message, headers, host, delay, app }) { | ||
this.seen_at = Date.now(); | ||
@@ -111,2 +118,3 @@ this.delay = delay; | ||
this.host = host; | ||
this.app = app; | ||
} | ||
@@ -188,2 +196,3 @@ | ||
axios(this.requestOptions) | ||
.then(() => this.app.emit('reply')) | ||
.then(resolve) | ||
@@ -190,0 +199,0 @@ .catch(reject), |
{ | ||
"name": "fraight-bot-client", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74888
2100