AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

MS Bot Framework Help needed
 
 

Hello,
I have a problem, i must task offered Microsoft one in this offered framework make and which offered shall distribute merry-go-round in the result of Hero Cards, he does this I must incredibly, now make the results “click cash” or insert a badge, too, however, the result gets callable perhaps in a new one.
The second problem is, how I can think offered in Facebook insert

Sorry, for the many questions I am a greenhorn in this area: -)

Best from Munich

Flo

var rp = require("request-promise");

var 
builder = require("botbuilder");
var 
restify = require("restify");
// Setup Restify Server
var server restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function() {
  console
.log("%s listening to %s"server.nameserver.url);
});
var 
connector = new builder.ChatConnector({
  appId
process.env.MICROSOFT_APP_ID,
  
appPasswordprocess.env.MICROSOFT_APP_PASSWORD
}
);

// Eingabe des Benutzers empfangen
server.post("/api/messages"connector.listen());


var 
bot = new builder.UniversalBot(connector[
  
function(session{
    session
.send(
      
"Hey ich helfe dir bei der Jobsuche!"
    
);
    
session.beginDialog("askForjob");
  
  
}
  
]
);

// Dialog um nach dem Job zu fragen
bot.dialog("askForjob"[
  
function(session{
    session
.dialogData.query {};
    
builder.Prompts.text(
      
session,
      
"Gib mir ein Stichwort nach welchem Job Ich suchen soll"
    
);
  
},
  function(
sessionresultsnext{
    
if (results.response{
      session
.dialogData.query.keyword results.response;
      
builder.Prompts.text(
        
session,
        `
Wo soll ich für Dich nach ${session.dialogData.query.keyword} suchen?`
      );
    
else {
      next
();
    
}
  }
,
  function(
sessionresults{
    
if (results.response{
      session
.dialogData.query.location_label results.response;
      
session.send(
        
        `
Ich habe in ${session.dialogData.query.location_label} nach ${session
          .dialogData.query.keyword} gesucht, dass habe ich gefunden :
`
      );
      var 
options {
      uri
: `https://jnprod.herokuapp.com/v1/b2c/jobs?keywords=${session
        .dialogData.query.keyword}&location;_label=
${session.dialogData.query
        .location_label}&per_page=10
`,
      
jsontrue
    }
;
    
rp(options).then(res => {
      
//session.send(res.jobs.map(e => e.title).join("<br/>"))
      
var attachments =  res.jobs.map((e)=> {
         
return new builder.HeroCard(session)
            .
title(e.title)
            .
subtitle(e.city)
            .
text(e.description.substring(0,100))
            .
images([
            builder
.CardImage.create(
                
session,
                
e.picture_url
                
)
            
])
    
})
       var 
msg = new builder.Message(session);
        
msg.attachmentLayout(builder.AttachmentLayout.carousel);
        
msg.attachments(attachments);
        
session.send(msg).endDialog();

    
});
    
}
  }
  
]
); 
 

 
  [ # 1 ]

Hello Florian:

I would be happy to help you, but I don’t understand.

What do you need help with?  Please let me know.

 

 
  [ # 2 ]

Jasson,

I think Flo means…

I have a problem, I have to do the task that is made available in the framework offered , and it offers to distribute the Merry-Go-Round as a result of HeroCards. To me this is unbelievable that it can do that now. Results “click cash”, or insert a badge, mean the results may be callable in a new one.  The second problem is how to put it on Facebook?

Here is a German translation, if anyone would like to help further…

Ich habe ein Problem, ich muss die Aufgabe, die in einem angebotenen Framework zugänglich gemacht wird, und das angeboten wird, soll das Merry-Go-Round im Ergebnis von Hero Cards verteilen, er tut dies, das ich unglaublich mache, jetzt mach die Ergebnisse “click cash” oder einfügen ein Abzeichen aber auch das Ergebnis wird vielleicht in einem neuen kalligierbar.
Das zweite Problem ist, wie kann ich denken, angeboten bei Facebook einfügen?

 

 
  [ # 3 ]

Hello Florian & Guru:

OK, I think I understand a little better now (but not too sure though).

Perhaps these resources can help:

Here’s a link to Microsoft’s GitHub repository for a sample Visual Studio project in Node.js for Hero Cards: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/cards-RichCards

And here’s a link on how to connect a Microsoft bot to Facebook Messenger: https://docs.microsoft.com/en-us/bot-framework/channel-connect-facebook

Hope this helps!

 

 
  login or register to react