botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Trigger function from middleware

Open suvamsh opened this issue 9 years ago • 3 comments

I am using the following code to reset the dialog state but I would also like to clear the session.userData at the same time. Is it possible to trigger another function that executes when a user types 'reset'?

// Anytime the major version is incremented any existing conversations will be restarted. bot.use(builder.Middleware.dialogVersion({ version: 1.0, resetCommand: /^reset/i }));

suvamsh avatar Jan 18 '17 19:01 suvamsh

Yes, you might consider a trigger action attached to the root dialog that recognizes the reset command and takes your desired action.

willportnoy avatar Jan 19 '17 22:01 willportnoy

Hi @suvamsh, were you able to figure this out?

Andrea-Orimoto avatar Feb 14 '17 19:02 Andrea-Orimoto

Closing for now. Let us know if you could not figure this out.

carlosscastro avatar Mar 09 '17 18:03 carlosscastro