Commit aee84986 authored by Tammo Ronke's avatar Tammo Ronke

redirect v2

parent 5276fe57
......@@ -12,6 +12,7 @@ module.exports = [
(session, results) => {
if (results.response.entity === "Bye Bye") {
session.userData = {};
session.reset();
session.replaceDialog("welcome");
} else {
session.endDialog();
......
......@@ -32,7 +32,13 @@ const suggCard = (session, sugg) => {
.title(sugg.title)
.images([builder.CardImage.create(session, GSearch.getImg(sugg.title))])
.buttons([
builder.CardAction.openUrl(session, sugg.url, "Open Website"),
builder.CardAction.openUrl(
session,
`http://localhost:3978/redirect/${encodeURI(
session.logger.address
)}/${encodeURI(sugg.url)}`,
"Open Website"
),
builder.CardAction.postBack(
session,
JSON.stringify(sugg),
......
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