Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda