diff --git a/utils/command.js b/utils/command.js index 38e628e..b61c607 100644 --- a/utils/command.js +++ b/utils/command.js @@ -124,7 +124,7 @@ export function createCRUDCommandRules (cmdPrefix, name, variable, detail = true this[`importCloud${upperVariable}`] = async function (e) { const id = e.msg.replace(new RegExp(cmdPrefix + `导入${name}`), '') if (id) { - const instance = await manager.getInstanceByCloudId(id) + const instance = manager.getInstanceByCloudId ? (await manager.getInstanceByCloudId(id)) : (await manager.getInstanceTByCloudId(id)) if (instance) { e.reply(`${name}已存在,尝试导入最新版本`, true) } diff --git a/utils/group.js b/utils/group.js index ed6c029..52f3eb3 100644 --- a/utils/group.js +++ b/utils/group.js @@ -133,7 +133,7 @@ export async function getGroupContextPrompt (e, length) { // eslint-disable-next-line no-template-curly-in-string .replace('${message.sender.title}', sender.title || '-') // eslint-disable-next-line no-template-curly-in-string - .replace('${message.time}', formatTimeToBeiJing(chat.time) || '-') + .replace('${message.time}', chat.time ? formatTimeToBeiJing(chat.time) : '-') // eslint-disable-next-line no-template-curly-in-string .replace('${message.messageId}', chat.messageId || '-') // eslint-disable-next-line no-template-curly-in-string