Open easaiIT opened 11 months ago
⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 5 GPT-4 tickets left. For more GPT-4 tickets, visit our payment portal.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
From looking through the relevant snippets, I decided to make the following modifications:
File Path | Proposed Changes |
---|---|
src/structures/Chat.js |
Add a new method exportChatHistory that retrieves all messages from the chat history using the fetchMessages method. The method should call a new helper function formatChatHistory from Util.js to format the messages into a user-friendly format. Then, it should use the fs module to create a file with the formatted chat history and return this file. |
src/util/Util.js |
Add a new helper function formatChatHistory that takes an array of messages as input and returns a string with the formatted chat history. The function should iterate over the array of messages and format each message into a user-friendly format such as JSON or CSV. |
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
Add exportChatHistory method to Chat class
sweep/feature/export-chat-history
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
- Added a new method
exportChatHistory
to theChat
class insrc/structures/Chat.js
- Created a new helper function
formatChatHistory
insrc/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
I have finished coding the issue. I am now reviewing it for completeness.
Success! 🚀
I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind! Join Our Discord
Is there an existing issue for this?
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like.
First I would like to thank you for this amazing project.
I searched briefly and didn't find anything related to the functionality of exporting conversations to a file. I looked through whatsapp web and did not find the option and I believe this is a problem.
The functionality would allow you to download the history of the selected conversation.
Describe an alternate solution.
No response
Additional context
Sometimes we need to look at a user's conversation history to get some context on the current conversation.
I don't know if the archive would be ideal, but anything that brings back old conversations would be really helpful.