Skip to content

Commit edde233

Browse files
authored
Refinements.
1 parent 17b9634 commit edde233

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/chatbot.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var chatbot = {
1515
},
1616
loadFiles: function(filenames) {
1717
bot = new RiveScript();
18-
bot.loadFile(filenames, on_load_success, on_load_error);
18+
bot.loadFile(filenames).then(on_load_success).catch(on_load_error);
1919
},
2020
getReply: function(text) {
2121
bot.reply(null, text).then(
@@ -39,7 +39,8 @@ var chatbot = {
3939
reply +
4040
"</span></div>"
4141
);
42-
pop.play();
42+
if (typeof pop !== "undefined") pop.play();
43+
if (typeof onChatbotReply === "function") onChatbotReply();
4344
$("#" + rand)
4445
.hide()
4546
.fadeIn(200);

0 commit comments

Comments
 (0)