mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix(bym): BUG
- 修复了目录叠叠乐了 - 临时修复发收表情包会把指令一起发出来
This commit is contained in:
parent
c817a6d77d
commit
72e77947c3
3 changed files with 9 additions and 8 deletions
|
|
@ -107,11 +107,11 @@ export async function downImg(e, image, t) {
|
|||
}
|
||||
const currentTime = moment().format("YYMMDDHHmmss");
|
||||
const safeTag = kWord.replace(/[^a-zA-Z0-9\u4e00-\u9fa5-_]/g, '-');
|
||||
const picPath = pathModule.join(PICTURES_DIR, 'pictures', `${currentTime}-${safeTag.substring(0, 200)}.${picType}`);
|
||||
const picPath = pathModule.join(PICTURES_DIR, `${currentTime}-${safeTag.substring(0, 200)}.${picType}`);
|
||||
logger.mark("DOWNIMG:", picPath);
|
||||
|
||||
if (!fs.existsSync(pathModule.join(PICTURES_DIR, 'pictures'))) {
|
||||
fs.mkdirSync(pathModule.join(PICTURES_DIR, 'pictures'), { recursive: true });
|
||||
if (!fs.existsSync(pathModule.join(PICTURES_DIR))) {
|
||||
fs.mkdirSync(pathModule.join(PICTURES_DIR), { recursive: true });
|
||||
}
|
||||
fs.writeFileSync(picPath, imageBuffer);
|
||||
logger.info(`图片已保存,标签为:${kWord}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue