diff --git a/src/file.js b/src/file.js index 398aa72..ea65b44 100644 --- a/src/file.js +++ b/src/file.js @@ -30,9 +30,14 @@ function writeFile({ value, fileName = configFileName }) { function deleteFile(fileName = historyFileName) { $file.delete(getFilePath(fileName)); } +function deleteAllFile() { + $file.delete(getFilePath(configFileName)); + $file.delete(getFilePath(historyFileName)); +} exports.configFileName = configFileName; exports.historyFileName = historyFileName; exports.readFile = readFile; exports.writeFile = writeFile; exports.deleteFile = deleteFile; +exports.deleteAllFile = deleteAllFile; diff --git a/src/info.json b/src/info.json index a07328d..c587ccc 100644 --- a/src/info.json +++ b/src/info.json @@ -1,6 +1,6 @@ { "identifier": "com.akl.bob-plugin-akl-chatgpt-free-translate", - "version": "2.0.8", + "version": "2.0.9", "category": "translate", "name": "Free ChatGPT", "summary": "免秘钥免启动任何服务调用ChatGPT", diff --git a/src/utils.js b/src/utils.js index b9f67e4..f693d12 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,5 +1,5 @@ var config = require('./config.js'); -var {configFileName, readFile, writeFile, deleteFile} = require("./file"); +var {configFileName, readFile, writeFile, deleteFile,deleteAllFile} = require("./file"); const langMap = new Map(config.supportedLanguages); const langMapReverse = new Map(config.supportedLanguages.map(([standardLang, lang]) => [lang, standardLang])); @@ -47,6 +47,11 @@ function getDirectiveResult(text) { deleteFile(); return "已清除对话记录,你可以继续聊天。"; + case "#重置": + case "#reset": + case "#Reset": + deleteAllFile(); + return "已重置所有设置,你可以继续聊天。"; } writeFile({