Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda