From 341926dc1b43843d831de513a8651eed03eac210 Mon Sep 17 00:00:00 2001 From: misaka20002 <40714502+misaka20002@users.noreply.github.com> Date: Wed, 13 Aug 2025 10:47:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=E6=9F=90=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=B8=8Ameme=E8=8E=B7=E5=8F=96=E7=9A=84user=5Finfos.name?= =?UTF-8?q?=E4=B8=BAundefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- karin-meme.js | 24 ++++++++++++------------ meme.js | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/karin-meme.js b/karin-meme.js index 0ab4ba8..46c7395 100644 --- a/karin-meme.js +++ b/karin-meme.js @@ -456,7 +456,7 @@ function handleArgs(key, args, userInfos) { argsObj.user_infos = userInfos.map(u => { return { - name: _.trim(u.text, '@'), + name: _.trim(u.text || u.name, '@'), gender: u.gender || 'unknown' } }) @@ -529,18 +529,18 @@ function generateSupportArgsText(info) { const exampleName = chineseNames.length > 0 ? chineseNames[0] : valueNames[0]; return `${description || prop},可选值:${valuesText}。如#${exampleName}`; } - // 处理数字类型 - else if (propInfo.type === 'integer' || propInfo.type === 'number') { - // 添加数字范围说明(如果有) - let rangeText = ''; - if (propInfo.minimum !== undefined && propInfo.maximum !== undefined) { - rangeText = `范围为${propInfo.minimum}~${propInfo.maximum}`; - } else if (propInfo.description && propInfo.description.includes('范围')) { - rangeText = propInfo.description; - } + // 处理数字类型 + else if (propInfo.type === 'integer' || propInfo.type === 'number') { + // 添加数字范围说明(如果有) + let rangeText = ''; + if (propInfo.minimum !== undefined && propInfo.maximum !== undefined) { + rangeText = `范围为${propInfo.minimum}~${propInfo.maximum}`; + } else if (propInfo.description && propInfo.description.includes('范围')) { + rangeText = propInfo.description; + } - return `${description || prop}${rangeText ? ',' + rangeText : ''}。如#1`; - } + return `${description || prop}${rangeText ? ',' + rangeText : ''}。如#1`; + } } break; diff --git a/meme.js b/meme.js index deb8a0c..cc0ed06 100644 --- a/meme.js +++ b/meme.js @@ -492,7 +492,7 @@ function handleArgs(key, args, userInfos) { argsObj.user_infos = userInfos.map(u => { return { - name: _.trim(u.text, '@'), + name: _.trim(u.text || u.name, '@'), gender: u.gender || 'unknown' } }) @@ -616,7 +616,7 @@ function mkdirs(dirname) { } } -async function getMasterQQ () { +async function getMasterQQ() { return (await import('../../lib/config/config.js')).default.masterQQ }