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) {