Commit f3bc0551 authored by Tammo Ronke's avatar Tammo Ronke

null

parent d1aaac6f
......@@ -42,8 +42,8 @@ server.post("/api/messages", connector.listen());
*/
// Make sure you add code to validate these fields
var luisAppId = process.env.LuisAppId;
var luisAPIKey = process.env.LuisAPIKey;
const luisAppId = "e7fcc4d6-8558-431e-a697-5e96e57e8c2d";
const luisAPIKey = "6a06603bba3d407b833e918f0d587527";
const luisAPIHostName =
process.env.LuisAPIHostName || "westus.api.cognitive.microsoft.com";
......@@ -62,19 +62,31 @@ bot.recognizer(recognizer);
/*
* Dialogs
*/
bot.dialog("welcome", require("./dialogs/welcome"));
bot.dialog("settings", require("./dialogs/welcome"));
bot
.dialog("delete", session => {
session.send("t");
session.userData.enrolled = {};
session.send("Deleted: userData");
.dialog("debug", session => {
session.beginDialog("welcome");
})
.triggerAction({
matches: "delete"
matches: "settings"
});
bot.dialog("/", session => {
session.send("this.luisAPIKeys");
bot.on("conversationUpdate", function(activity) {
if (activity.membersAdded) {
const hello = new builder.Message()
.address(activity.address)
.text("Welcome....");
activity.membersAdded.forEach(function(identity) {
// say hello only when bot joins and not when user joins
if (identity.id === activity.address.bot.id) {
bot.beginDialog(activity.address, "welcome");
}
});
}
});
bot.dialog("welcome", require("./dialogs/welcome"));
bot.dialog("/", session => {
session.send("nothing implemented");
});
var builder = require("botbuilder");
module.exports = [
(session, args, next) => {
// const entUserData = builder.EntityRecognizer.findEntity(
// args.intent.entities,
// "settings.userData"
// );
const msg = new builder.Message(session).addAttachment(
settingsCard(session)
);
session.send(msg);
}
];
const settingsCard = session => {
return new builder.HeroCard(session)
.title('BotFramework Hero Card')
.subtitle('Your bots — wherever your users are talking')
.buttons([
builder.CardAction.
]);
};
......@@ -2,6 +2,24 @@ var builder = require("botbuilder");
module.exports = [
session => {
session.send("hi");
const msg = new builder.Message(session).addAttachment(
welcomeCard(session)
);
session.send(msg);
session.endDialog();
}
];
const welcomeCard = session => {
return new builder.HeroCard(session)
.title("Welcome to GlaDos!")
.text(
"I am GlaDos, if you want to learn anything, just ask me and I will try to provide you with useful information!"
)
.images([
builder.CardImage.create(
session,
"https://assets.gitlab-static.net/uploads/-/system/project/avatar/6142850/ezgif-4-9305c3684f.gif"
)
]);
};
......@@ -29,8 +29,7 @@ npm manifest:
"zip-folder": "^1.0.0"
},
"scripts": {
"bot":
"LuisAppId=e7fcc4d6-8558-431e-a697-5e96e57e8c2d LuisAPIKey=6a06603bba3d407b833e918f0d587527 node ./app.js",
"bot": "node ./app.js",
"clean":
"rm -rf ./dist && rm -rf ./test && rm -rf ./node_modules && rm -f ./yarn.lock && rm -f ./package-lock.json && rm -rf ./yarn-error.log && clear && echo -e \"\\e[1;31mFinished cleaning!\\e[0m\""
},
......@@ -1326,7 +1325,7 @@ Trace:
Error: Command failed.
Exit code: 1
Command: sh
Arguments: -c LuisAppId=e7fcc4d6-8558-431e-a697-5e96e57e8c2d LuisAPIKey=6a06603bba3d407b833e918f0d587527 node ./app.js
Arguments: -c node ./app.js
Directory: /home/tammo/Documents/data-ki-bots
Output:
......
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