From 75c8d3d5fec641bea1c2819cd117151ccc7cb015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=8C=8C?= Date: Fri, 19 Jan 2024 20:36:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/apps/exchange.js | 6 +++--- plugins/genshin/model/mys/mysInfo.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/genshin/apps/exchange.js b/plugins/genshin/apps/exchange.js index 38cc92d..22ddde4 100644 --- a/plugins/genshin/apps/exchange.js +++ b/plugins/genshin/apps/exchange.js @@ -16,7 +16,7 @@ export class exchange extends plugin { fnc: 'getCode' }, { - reg: '^#(兑换码使用|cdk-u) .+', + reg: '^#(兑换码使用|cdk-u).+', fnc: 'useCode' } ] @@ -126,8 +126,8 @@ export class exchange extends plugin { } // 兑换码使用 async useCode() { - let cdkCode = this.e.message[0].text.split(/#(兑换码使用|cdk-u) /, 3)[2]; - let res = await MysInfo.get(this.e, 'useCdk', { cdk: cdkCode }) + const cdkCode = this.e.msg.replace(/#(兑换码使用|cdk-u)/, "").trim() + const res = await MysInfo.get(this.e, 'useCdk', { cdk: cdkCode }) if (res) { this.e.reply(`${res.data.msg}`) } diff --git a/plugins/genshin/model/mys/mysInfo.js b/plugins/genshin/model/mys/mysInfo.js index bdaa78c..617419e 100644 --- a/plugins/genshin/model/mys/mysInfo.js +++ b/plugins/genshin/model/mys/mysInfo.js @@ -118,7 +118,7 @@ export default class MysInfo { if (e.noTips !== true) e.reply(['请先#绑定uid', segment.button([ { text: "绑定UID", input: "#绑定uid" }, - ])], false, { at }) + ])], false, { at: at || true }) return false } @@ -315,7 +315,7 @@ export default class MysInfo { if (!this.uid) { this.e.reply(['请先#绑定uid', segment.button([ { text: "绑定UID", input: "#绑定uid" }, - ])]) + ])], false, { at: true }) } if (!this.ckInfo.ck) {