feat(bym): 加个表情包开关

This commit is contained in:
ycxom 2024-12-31 19:01:08 +08:00
parent 077e7e7d59
commit db3c7b55e9
3 changed files with 20 additions and 7 deletions

View file

@ -40,7 +40,8 @@ export async function getToimg(e, tag) {
logger.warn(`未找到匹配的表情包: ${sanitizedTag}`);
return;
}
const selectedFile = matchedFiles[0];
// 随机选择一个文件
const selectedFile = matchedFiles[Math.floor(Math.random() * matchedFiles.length)];
const picPath = pathModule.join(picturesPath, selectedFile);
try {
await fs.promises.access(picPath);