Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
merge in some prs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Brown committed Jan 29, 2018
1 parent 1a52b4b commit fc50b37
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
Merged Pull Requests:
* Make sure Facebook API errors are passed to callback if specified [PR #1225](https://github.com/howdyai/botkit/pull/1225)
* Refresh Microsoft Teams token when it has expired. [PR #1230](https://github.com/howdyai/botkit/pull/1230)

* Update TypeScript definition for Web bots [PR #1231](https://github.com/howdyai/botkit/pull/1231)
* Update TypeScript definition for bot.replyAndUpdate [PR #1232](https://github.com/howdyai/botkit/pull/1232)
* Fix for Microsoft teams button builder function [PR #1233](https://github.com/howdyai/botkit/pull/1233)

# 0.6.8

Expand Down
62 changes: 31 additions & 31 deletions lib/Studio.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,38 +182,38 @@ module.exports = function(controller) {
return new Promise(function(resolve, reject) {
controller.studio.getScript(bot, input_text, user).then(function(command) {
if (command !== {} && command.id) {
controller.trigger('command_triggered', [bot, context, command]);

// make the script source information from Botkit Studio available to Botkit's convo object
context.script_name = command.command;
context.script_id = command._id;

controller.studio.compileScript(
bot,
context,
command
).then(function(convo) {
convo.on('end', function(convo) {
runHooks(
after_hooks[command.command] ? after_hooks[command.command].slice() : [],
convo,
function(convo) {
controller.trigger('remote_command_end', [bot, context, command, convo]);
}
);
});
runHooks(
before_hooks[command.command] ? before_hooks[command.command].slice() : [],
convo,
function(convo) {
resolve(convo);
}
);
}).catch(function(err) {
reject(err);
});
controller.trigger('command_triggered', [bot, context, command]);

// make the script source information from Botkit Studio available to Botkit's convo object
context.script_name = command.command;
context.script_id = command._id;

controller.studio.compileScript(
bot,
context,
command
).then(function(convo) {
convo.on('end', function(convo) {
runHooks(
after_hooks[command.command] ? after_hooks[command.command].slice() : [],
convo,
function(convo) {
controller.trigger('remote_command_end', [bot, context, command, convo]);
}
);
});
runHooks(
before_hooks[command.command] ? before_hooks[command.command].slice() : [],
convo,
function(convo) {
resolve(convo);
}
);
}).catch(function(err) {
reject(err);
});
} else {
reject('Script not found');
reject('Script not found');
}
}).catch(function(err) {
reject(err);
Expand Down

0 comments on commit fc50b37

Please sign in to comment.