Identifying chat window closed by user using Botkit

Hi,

I am trying to configure universal bot for a project and I am required to create an incident ticket when User asks for status of a ticket using bot dialog task. In the event that user closes the chat in the middle of the conversation, I need to resolve the created incident ticket with chat log, which I am saving in BotContext as this does not get cleared when session is closed.

Any ideas how this can be implemented using botkit?

I will be looking forard to your response as I am on a time constraint.

Thanks,
Kumar Shantam.