fix(bym): BUG

- 修复了目录叠叠乐了
- 临时修复发收表情包会把指令一起发出来
This commit is contained in:
ycxom 2025-01-02 09:48:29 +08:00
parent c817a6d77d
commit 72e77947c3
3 changed files with 9 additions and 8 deletions

View file

@ -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}`);