Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
how to end coversation in bot framework using node js

i'm using trigger action and end conversation to end my chat..but it closes the current dialog of the chat... i want end the chat history or data ....

and i'm trying this code..

bot.dialog('/end', function (session) {
session.endConversation("End Conversation");
}).triggerAction({ matches: /^(exit)|(quit)/i });
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

You could try using

session.clearDialogStack()

or

session.reset();
session.endDialog();

Here you will find info about reset and here about clearDialogStack.

over 4 years ago · Santiago Trujillo Report

0

You can use this simple middleware to clear userData/conversationData bags:

export interface IResetDataSettings {
    resetCommand: RegExp;
}

export class ResetMiddleware {
    public static data(settings: IResetDataSettings): IMiddlewareMap {
        return {
            botbuilder: (session, next) => {
                if (settings.resetCommand && session.message.text && settings.resetCommand.test(session.message.text)) {
                    session.userData = {};
                    session.conversationData = {};
                    session.privateConversationData = {};
                    session.endConversation("Your conversation state was reset.");
                } else {
                    next();
                }
            }
        };
    }
}

Then setup it like this:

this.bot.use(ResetMiddleware.data({ resetCommand: /^reset data$/i }));
over 4 years ago · Santiago Trujillo Report

0

You can use the command “/deleteprofile” to delete the User/PrivateConversation bot data bag state and reset your bot. Note, some channels interpret slash-commands natively, so it may be necessary to send the command with a space in front (“ /deleteprofile”)

From here: https://docs.botframework.com/en-us/technical-faq#my-bot-is-stuck--how-can-i-reset-the-conversation

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!