Skip to content

Commit

Permalink
Merge branch 'hotfix/0.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
webus committed Aug 14, 2017
2 parents 4505b32 + 7f44e6a commit 9a1a1bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botstack",
"version": "0.0.3",
"version": "0.0.4",
"description": "Bot Stack",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions src/botstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class BotStack {

this.server.post('/smooch/webhook/', this._smoochWebhook(this)); // eslint-disable-line no-underscore-dangle

this.server.post('/apiaidb/', (req, res, next) => {
this.server.post('/apiaidb/', function (req, res, next) {
res.json({
speech: req.body.result.fulfillment.speech,
displayText: req.body.result.fulfillment.speech,
Expand Down Expand Up @@ -287,7 +287,7 @@ class BotStack {
if (msg.role !== 'appUser') {
continue;
}
this.log.debug('New message from Smooch endpoint', {
self.log.debug('New message from Smooch endpoint', {
module: 'botstack:smoochWebhook',
message: msg
});
Expand All @@ -298,12 +298,12 @@ class BotStack {
try {
apiAiResponse = await self.apiai.processTextMessage(text, authorID);
result = await smooch.processMessagesFromApiAi(apiAiResponse, authorID);
this.log.debug('Smooch API result', {
self.log.debug('Smooch API result', {
module: 'botstack:smoochWebhook',
result
});
} catch (err) {
this.log.error(err, {
self.log.error(err, {
module: 'botstack:smoochWebhook'
});
}
Expand Down Expand Up @@ -346,7 +346,7 @@ class BotStack {
const self = context;
return async function (req, res, next) { // eslint-disable-line no-unused-vars
res.end();
await this._syncFbMessageToBackChat(req); // eslint-disable-line no-underscore-dangle
await self._syncFbMessageToBackChat(req); // eslint-disable-line no-underscore-dangle
const entries = req.body.entry;
for (const entry of entries) {
const messages = entry.messaging;
Expand Down Expand Up @@ -516,10 +516,10 @@ class BotStack {
const port = process.env.PORT || 1337;
const self = this;
this.server.listen(port, () => {
self.log.info(`Bot '${this.botName}' is ready`, {
self.log.info(`Bot '${self.botName}' is ready`, {
module: 'botstack'
});
self.log.info(`listening on port:${port} ${this.server.name} ${this.server.url}`, {
self.log.info(`listening on port:${port} ${self.server.name} ${self.server.url}`, {
module: 'botstack'
});
});
Expand Down

0 comments on commit 9a1a1bc

Please sign in to comment.