From 50b5e2c2ef23e2a83d5f041d1036fb92791039a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A0=E6=AA=AC=E5=86=B2=E6=B0=B4?= <10424920+ningmengchongshui@user.noreply.gitee.com> Date: Mon, 23 Oct 2023 19:01:56 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0q-yunzai=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 柠檬冲水 <10424920+ningmengchongshui@user.noreply.gitee.com> --- index.ts | 8 -------- main.js | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) delete mode 100644 index.ts create mode 100644 main.js diff --git a/index.ts b/index.ts deleted file mode 100644 index 2544e9ea..00000000 --- a/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createApp, getAppName } from 'alemonjs' -const AppName = getAppName(import.meta.url) -const { apps } = await import('./apps/index.js').finally(() => { - console.log('[APP] 喵喵插件 启动') -}) -const app = createApp(AppName) -app.component(apps) -app.mount() \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 00000000..8aa205a9 --- /dev/null +++ b/main.js @@ -0,0 +1,12 @@ +import { createApps } from 'alemonjs' +import { apps } from './index.js' +const app = createApps(import.meta.url) +app.setMessage(async e => { + const data = await runtime.init(e) + e = data.e + e.sender = {} + e.sender.card = e.user_name + return e +}) +app.component(apps) +app.mount() From 66b1593e434ed51a70ea666bcebef81bb1177422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=A0=E6=AA=AC=E5=86=B2=E6=B0=B4?= <10424920+ningmengchongshui@user.noreply.gitee.com> Date: Tue, 24 Oct 2023 08:49:31 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=9B=E5=BB=BAA-Yunzai=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E5=B9=B6=E4=BF=AE=E5=A4=8D=E5=B5=8C=E5=A5=97runtime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 柠檬冲水 <10424920+ningmengchongshui@user.noreply.gitee.com> --- components/Version.js | 14 +++++++++++--- index.js | 2 +- main.js | 5 ++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/components/Version.js b/components/Version.js index d4222a53..e08eee90 100644 --- a/components/Version.js +++ b/components/Version.js @@ -78,19 +78,27 @@ const { changelogs, currentVersion } = readLogFile('miao') const yunzaiVersion = packageJson.version const isV3 = yunzaiVersion[0] === '3' let isMiao = false -let name = "Yunzai-Bot" +let name = 'Yunzai-Bot' +let isAlemonjs = false if (packageJson.name === 'miao-yunzai') { isMiao = true - name = "Miao-Yunzai" + name = 'Miao-Yunzai' } else if (packageJson.name === 'trss-yunzai') { isMiao = true - name = "TRSS-Yunzai" + name = 'TRSS-Yunzai' +} +else if (packageJson.name === 'a-yunzai') { + isMiao = true + name = 'A-Yunzai' + isAlemonjs = true } + let Version = { isV3, isMiao, name, + isAlemonjs, get version () { return currentVersion }, diff --git a/index.js b/index.js index 585b9ef6..38d91ed2 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ setTimeout(async function () { let msgs = [`当前喵喵版本: ${Version.version}`, '您可使用 #喵喵版本 命令查看更新信息'] await relpyPrivate(msg.qq, msgs.join('\n')) } - if (!Version.isV3) { + if (!Version.isV3 && !Version.isAlemonjs) { console.log('警告:miao-plugin需要V3 Yunzai,请升级至最新版Miao-Yunzai以使用miao-plugin') } if (!fs.existsSync(process.cwd() + '/lib/plugins/runtime.js')) { diff --git a/main.js b/main.js index 8aa205a9..7cf656e4 100644 --- a/main.js +++ b/main.js @@ -2,11 +2,10 @@ import { createApps } from 'alemonjs' import { apps } from './index.js' const app = createApps(import.meta.url) app.setMessage(async e => { - const data = await runtime.init(e) - e = data.e + await runtime.init(e) e.sender = {} e.sender.card = e.user_name return e }) app.component(apps) -app.mount() +app.mount() \ No newline at end of file