Commit d473b96d authored by Tammo Ronke's avatar Tammo Ronke

v23424324wgr

parent 471f4cf1
......@@ -13,7 +13,6 @@ module.exports = [
(session, results) => {
if (results.response.entity === "Bye Bye") {
session.userData = {};
session.reset();
session.replaceDialog("welcome");
} else {
session.endDialog();
......@@ -29,7 +28,7 @@ const confirmCard = (session, topic, img) => {
])
)
.buttons([
builder.CardAction.imBack(session, "Bye Bye", "Of course"),
builder.CardAction.postBack(session, "Bye Bye", "Of course"),
builder.CardAction.imBack(session, "I changed my mind", "Never")
]);
};
......@@ -28,7 +28,11 @@ module.exports = [
session.dialogData.topic = session.dialogData.topic || args.response;
if (!session.dialogData.skillLevel) {
const choices = ["Nothing", "Something", "A lot"];
const choices = [
"I'm a beginner",
"I have some experience",
"I'm a pro"
];
const reply = new builder.Message(session).addAttachment(
diffCard(session, choices)
......
......@@ -11,13 +11,18 @@ module.exports = [
session.send(msg);
setTimeout(() => next(), 800);
} else {
if (store.getRecentTopics(6, session.userData) === [])
if (
store.getRecentTopics(6, session.userData) &&
typeof store.getRecentTopics(6, session.userData) == Array &&
store.getRecentTopics(6, session.userData).length >= 0
)
session.replaceDialog("recent");
else {
const msg = new builder.Message(session).addAttachment(
welcomeCard(session)
);
session.send(msg);
session.send("What do you wanna learn about tody?");
session.endDialog();
}
}
......@@ -33,6 +38,7 @@ module.exports = [
answers.formatedRandomAnswer("name.update", [results.response])
);
session.userData.name = results.response;
session.send("What do you wanna learn about tody?");
session.endDialog();
}
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment