From 1233964e78c736e7528763d002a189fc26a78dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A3=9E?= <42599406+xfdown@users.noreply.github.com> Date: Mon, 22 May 2023 11:41:15 +0800 Subject: [PATCH] =?UTF-8?q?icqq=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E8=87=B30.3.14=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E8=A2=AB=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98=EF=BC=8Cold=5Fand?= =?UTF-8?q?roid=E6=94=B9=E4=B8=BA=E5=AE=89=E5=8D=938.8.88=EF=BC=8C?= =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=A0=81api=E8=B5=8B=E5=80=BCcode=5Fver?= =?UTF-8?q?=E3=80=82=20(#126)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/default_config/qq.yaml | 4 ++-- lib/config/init.js | 10 +++++----- lib/config/qq.js | 4 ++-- plugins/genshin/apps/exchange.js | 5 ++++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/config/default_config/qq.yaml b/config/default_config/qq.yaml index 6745bac..2407f95 100644 --- a/config/default_config/qq.yaml +++ b/config/default_config/qq.yaml @@ -2,5 +2,5 @@ qq: # 密码,为空则用扫码登录,扫码登录现在仅能在同一ip下进行 pwd: -# 1:安卓手机、 2:aPad 、 3:安卓手表、 4:MacOS 、 5:iPad 、 6:old_Android -platform: 5 \ No newline at end of file +# 1:安卓手机、 2:aPad 、 3:安卓手表、 4:MacOS 、 5:iPad 、 6:安卓8.8.88 +platform: 6 \ No newline at end of file diff --git a/lib/config/init.js b/lib/config/init.js index 64fbf05..6bfeb5d 100644 --- a/lib/config/init.js +++ b/lib/config/init.js @@ -31,7 +31,7 @@ async function UpdateTitle() { title += ' iPad' break case 6: - title += ' old_Android' + title += ' 安卓8.8.88' break default: } @@ -73,9 +73,6 @@ async function checkInit () { /** 检查qq.yaml */ await createQQ() - //** 更新标题 */ - await UpdateTitle() - /** 日志设置 */ setLog() @@ -83,5 +80,8 @@ async function checkInit () { await redisInit() - checkRun() + await checkRun() + + //** 更新标题 */ + await UpdateTitle() } diff --git a/lib/config/qq.js b/lib/config/qq.js index 36fa306..d6b99cd 100644 --- a/lib/config/qq.js +++ b/lib/config/qq.js @@ -33,10 +33,10 @@ export default async function createQQ () { message: '请选择登录端口:', name: 'platform', default: '6', - choices: ['old_Android', 'iPad', '安卓手机', '安卓手表', 'MacOS', 'aPad'], + choices: ['安卓8.8.88', 'iPad', '安卓手机', '安卓手表', 'MacOS', 'aPad'], filter: (val) => { switch (val) { - case 'old_Android':return 6 + case '安卓8.8.88':return 6 case 'iPad':return 5 case 'MacOS':return 4 case '安卓手机':return 1 diff --git a/plugins/genshin/apps/exchange.js b/plugins/genshin/apps/exchange.js index 892e518..d45807c 100644 --- a/plugins/genshin/apps/exchange.js +++ b/plugins/genshin/apps/exchange.js @@ -25,6 +25,7 @@ export class exchange extends plugin { } async getCode() { + this.code_ver = '' this.now = parseInt(Date.now() / 1000) let actid = await this.getActId() if (!actid) return @@ -36,8 +37,10 @@ export class exchange extends plugin { if (index.data === null) { return await this.reply(`错误:\n${index.message}`) } + let index_data = index.data.live; let title = index_data['title']; + this.code_ver = index_data['code_ver']; if (index_data.remain > 0) { return await this.reply(`暂无直播兑换码\n${title}`) } @@ -70,7 +73,7 @@ export class exchange extends plugin { async getData(type) { let url = { index: `https://api-takumi.mihoyo.com/event/miyolive/index`, - code: `https://api-takumi-static.mihoyo.com/event/miyolive/refreshCode?version=${this.code_ver}&time=${parseInt(new Date().getTime() / 1000)}`, + code: `https://api-takumi-static.mihoyo.com/event/miyolive/refreshCode?version=${this.code_ver}&time=${this.now}`, actId: "https://bbs-api.mihoyo.com/painter/api/user_instant/list?offset=0&size=20&uid=75276550", }