This PR adds a new method exportChatHistory to the Chat class in order to allow users to export the history of a selected conversation. The method retrieves all messages from the chat history using the existing fetchMessages method and formats them into a user-friendly format such as JSON or CSV. It also creates a downloadable file with the formatted chat history.
Summary of Changes
Added a new method exportChatHistory to the Chat class in src/structures/Chat.js
Created a new helper function formatChatHistory in src/util/Util.js to format the chat messages into a user-friendly format
Used the fs module to create a file with the formatted chat history
Updated the README.md file to include documentation for the new exportChatHistory method
Fixes #1.
To checkout this PR branch, run the following command in your terminal:
Description
This PR adds a new method
exportChatHistory
to theChat
class in order to allow users to export the history of a selected conversation. The method retrieves all messages from the chat history using the existingfetchMessages
method and formats them into a user-friendly format such as JSON or CSV. It also creates a downloadable file with the formatted chat history.Summary of Changes
exportChatHistory
to theChat
class insrc/structures/Chat.js
formatChatHistory
insrc/util/Util.js
to format the chat messages into a user-friendly formatfs
module to create a file with the formatted chat historyexportChatHistory
methodFixes #1.
To checkout this PR branch, run the following command in your terminal: