fix: 尝试支持设定分享和导入 (#286)

* fix: 尝试支持设定分享和导入

* fix: 设定分享和洗脑操作的帮助

* fix: 导入设定失败的提示

* fix: 允许覆盖修改

* fix: version
This commit is contained in:
ikechan8370 2023-03-26 16:15:15 +08:00 committed by GitHub
parent 07d1db0a2a
commit bfc55df6a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 268 additions and 16 deletions

View file

@ -221,6 +221,10 @@ export function mkdirs (dirname) {
}
}
export async function getMasterQQ () {
return (await import('../../../lib/config/config.js')).default.masterQQ
}
/**
*
* @param pluginKey plugin key

View file

@ -70,7 +70,7 @@ const defaultConfig = {
allowOtherMode: true,
sydneyContext: '',
emojiBaseURL: 'https://www.gstatic.com/android/keyboard/emojikitchen',
version: 'v2.3.4'
version: 'v2.4.0'
}
const _path = process.cwd()
let config = {}

View file

@ -40,3 +40,11 @@ export function saveOnePrompt (name, content) {
let filePath = `${_path}/plugins/chatgpt-plugin/prompts/${name}.txt`
fs.writeFileSync(filePath, content)
}
export function deleteOnePrompt (name) {
const _path = process.cwd()
mkdirs(`${_path}/plugins/chatgpt-plugin/prompts`)
let filePath = `${_path}/plugins/chatgpt-plugin/prompts/${name}.txt`
fs.unlinkSync(filePath)
}