Commit 3b6e7b5b authored by Tammo Ronke's avatar Tammo Ronke

v23424324

parent 4b102aef
......@@ -28,15 +28,13 @@ module.exports = [
session.dialogData.topic = session.dialogData.topic || args.response;
if (!session.dialogData.skillLevel) {
builder.Prompts.choice(
session,
answers.formatedRandomAnswer("learn.skill", [
session.userData.name,
session.dialogData.topic
]),
"nothing|something|a lot",
{ listStyle: 3 }
const choices = ["Nothing", "Something", "A lot"];
const reply = new builder.Message(session).addAttachment(
diffCard(session, choices)
);
builder.Prompts.choice(session, reply, choices);
} else next();
},
......@@ -97,3 +95,17 @@ const getDuration = entities => {
return duration.resolution.values[0].value;
return null;
};
const diffCard = (session, choices) => {
return new builder.HeroCard(session)
.text(
answers.formatedRandomAnswer("learn.skill", [
session.userData.name,
session.dialogData.topic
])
)
.buttons([
builder.CardAction.postBack(session, choices[0], choices[0]),
builder.CardAction.postBack(session, choices[1], choices[1]),
builder.CardAction.postBack(session, choices[2], choices[2])
]);
};
......@@ -25,20 +25,21 @@ const getSyns = base => {
let out = "";
let syns = {};
syns["learn"] = getSyns("learn");
syns["want"] = getSyns("search");
syns["need"] = getSyns("need");
syns["explore"] = getSyns("explore");
syns["about"] = getSyns("about");
syns["like"] = getSyns("like");
syns["have"] = getSyns("know");
syns["some"] = getSyns("a lot");
syns["knowledge"] = getSyns("medium");
syns["got"] = getSyns("got");
syns["average"] = getSyns("average");
syns["knowledge"] = getSyns("understanding");
for (let index = 0; index < 25; index++) {
out +=
"I " +
syns["have"][index] +
syns["need"][index] +
" " +
syns["about"][index] +
syns["explore"][index] +
" " +
randomTopic() +
" " +
randomTopic() +
" " +
......@@ -48,11 +49,9 @@ for (let index = 0; index < 25; index++) {
" " +
randomTopic() +
" and " +
syns["have"][index] +
syns["got"][index] +
" " +
syns["knowledge"][index] +
" " +
syns["about"][index] +
"\n";
}
......
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