Closed Purus closed 6 years ago
@Purus WDYM by booting with user info ?
In my understanding we need to pass on user information to store them along work message. Please correct me if I am wrong.
On Thu, May 31, 2018, 11:03 PM Ouadie Lahdioui notifications@github.com wrote:
@Purus https://github.com/Purus WDYM by booting with user info ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/howdyai/botkit/issues/1364#issuecomment-393611981, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBx5-UM5Q3fMpjQRvbYdx5e8FO2PtQOks5t4ClxgaJpZM4USs3Q .
which platform are you using (FB, Slack, WS, Web ...) ?
I am using web platform.
On Fri, Jun 1, 2018, 3:11 PM Ouadie Lahdioui notifications@github.com wrote:
which one are you using (FB, SLack, WS, Web ...) ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/howdyai/botkit/issues/1364#issuecomment-393829411, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBx57IZycIbIdpbdyvtitBBHNNHr5aaks5t4QwugaJpZM4USs3Q .
@Purus take a look at these docs for dealing with user data on the web client https://github.com/howdyai/botkit-starter-web/blob/master/docs/botkit_web_client.md#share-user-accounts--profile-data-with-botkit
Thanks @peterswimm . I have read those doc. But I want to pass the data from the bokit controller code as I have to do some LDAP calls to get the user info like name.
I have the same issue, can I by any means pass some values from the javascript where I embedded my bot on the web and use it in the controller to say validate the user and then respond accordingly?
@Purus @sudk97 you can add more keys: values to the object that you send to botkit from the frontend and then manage them with a middleware in botkit.
Any example on how to do this will be helpful.
On Mon, Jun 4, 2018, 3:52 PM Adán Toscano notifications@github.com wrote:
@Purus https://github.com/Purus @sudk97 https://github.com/sudk97 you can add more keys: values to the object that you send to botkit from the frontend and then manage them with a middleware in botkit.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/howdyai/botkit/issues/1364#issuecomment-394306638, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBx56xvcSsYqOQ0iN-kjEU1N98SJ2dwks5t5QpWgaJpZM4USs3Q .
I copied the function from here and add the following...
that.deliverMessage({
type: 'message',
text: text,
user: this.guid,
channel: this.options.use_sockets ? 'socket' : 'webhook'
custom: 'Purus rocks!'
});
then in botkit use middleware
controller.middleware.receive.use(function(bot, message, next) {
console.log(message.custom); //Puru rocks!
next();
});
Thanks a lot @adantoscano, worked for me :+1:
I have read docs on booting with user info. As per my understanding this needs to be done in the public client JavaScript code.
How do I pass entire user object values from my botkit controller, maybe before start hearing on.