We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17b9634 commit edde233Copy full SHA for edde233
1 file changed
src/chatbot.js
@@ -15,7 +15,7 @@ var chatbot = {
15
},
16
loadFiles: function(filenames) {
17
bot = new RiveScript();
18
- bot.loadFile(filenames, on_load_success, on_load_error);
+ bot.loadFile(filenames).then(on_load_success).catch(on_load_error);
19
20
getReply: function(text) {
21
bot.reply(null, text).then(
@@ -39,7 +39,8 @@ var chatbot = {
39
reply +
40
"</span></div>"
41
);
42
- pop.play();
+ if (typeof pop !== "undefined") pop.play();
43
+ if (typeof onChatbotReply === "function") onChatbotReply();
44
$("#" + rand)
45
.hide()
46
.fadeIn(200);
0 commit comments