Deploy: 2026-05-23 23:25:19
This commit is contained in:
@@ -668,10 +668,17 @@ async function checkContact(session_key, phone) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function exportChatHistory(session_key) {
|
async function exportChatHistory(session_key) {
|
||||||
const store = sessionStores.get(session_key);
|
let store = sessionStores.get(session_key);
|
||||||
if (!store) {
|
if (!store) {
|
||||||
|
const storeFile = path.join(SESSIONS_DIR, `${session_key}_store.json`);
|
||||||
|
if (fs.existsSync(storeFile)) {
|
||||||
|
store = makeInMemoryStore();
|
||||||
|
store.readFromFile(storeFile);
|
||||||
|
console.log(`[Store] Loaded store from file for ${session_key} (Export)`);
|
||||||
|
} else {
|
||||||
throw new Error(`No store found for session ${session_key}`);
|
throw new Error(`No store found for session ${session_key}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const chats = store.chats.all();
|
const chats = store.chats.all();
|
||||||
let outputText = `==================================================\n`;
|
let outputText = `==================================================\n`;
|
||||||
|
|||||||
Reference in New Issue
Block a user