Greetings.

Good people, who can explain in Russian what happens at the last stage of this scheme.

enter image description here

when the bot receives the message that the user sent it?

    1 answer 1

    It depends on what you mean, in the picture it is the REST API authentication process, it does not process the messages, they are necessary for example in order to send a message to the chat (if you know its number)

    In general, Bot's work for node.js looks like this (an example is almost from the documentation):

    var restify = require('restify'); var builder = require('botbuilder'); var server = restify.createServer(); server.listen(process.env.port || process.env.PORT || 3978, function () { console.log('%s listening to %s', server.name, server.url); }); // Create chat bot var connector = new builder.ChatConnector({ appId: process.env.MICROSOFT_APP_ID, appPassword: process.env.MICROSOFT_APP_PASSWORD }); var bot = new builder.UniversalBot(connector); server.post('/api/messages', connector.listen()); //========================================================= // Bots Dialogs //========================================================= //Обработаем команду / bot.dialog('/', function (session) { session.send('Твой ID'+ session.message.user.id); session.send('Твое Имя '+ session.message.user.name); console.log("Current message address",session.message.address); }); 

    As far as I remember, the address is the path (chat id) that you can then use to send something in response via the REST API.

    And session.send will respond to the chat immediately

    Those. According to the ideas of Skepy developers, you can create route processing and automatically respond to user requests, for everything else, such as news alerts or something like that, you should use RestAPI

    • Thanks for editing, I didn’t have enough rating to insert an image. I am writing in php, but if this fragment is enough to receive messages from the user, try js. I, perhaps, didn’t express my idea very clearly - there are no problems with sending messages, I use the ready-made library with github. Here with getting plugging. I re-read the docks for #botframework for a week, and I can’t find a clear explanation when that POST arrives with content (and not just with headers for authorization). - penishands
    • @ penishands first carefully read how to create and connect a bot when it just appeared, except on azure I think nowhere could the bot processor be placed, but I don’t remember exactly what it was almost a year ago. - Orange_shadow