细节优化

This commit is contained in:
🌌 2024-01-19 20:36:39 +08:00
parent 5feda74733
commit 75c8d3d5fe
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ export class exchange extends plugin {
fnc: 'getCode' fnc: 'getCode'
}, },
{ {
reg: '^#(兑换码使用|cdk-u) .+', reg: '^#(兑换码使用|cdk-u).+',
fnc: 'useCode' fnc: 'useCode'
} }
] ]
@ -126,8 +126,8 @@ export class exchange extends plugin {
} }
// 兑换码使用 // 兑换码使用
async useCode() { async useCode() {
let cdkCode = this.e.message[0].text.split(/#(兑换码使用|cdk-u) /, 3)[2]; const cdkCode = this.e.msg.replace(/#(兑换码使用|cdk-u)/, "").trim()
let res = await MysInfo.get(this.e, 'useCdk', { cdk: cdkCode }) const res = await MysInfo.get(this.e, 'useCdk', { cdk: cdkCode })
if (res) { if (res) {
this.e.reply(`${res.data.msg}`) this.e.reply(`${res.data.msg}`)
} }

View File

@ -118,7 +118,7 @@ export default class MysInfo {
if (e.noTips !== true) e.reply(['请先#绑定uid', segment.button([ if (e.noTips !== true) e.reply(['请先#绑定uid', segment.button([
{ text: "绑定UID", input: "#绑定uid" }, { text: "绑定UID", input: "#绑定uid" },
])], false, { at }) ])], false, { at: at || true })
return false return false
} }
@ -315,7 +315,7 @@ export default class MysInfo {
if (!this.uid) { if (!this.uid) {
this.e.reply(['请先#绑定uid', segment.button([ this.e.reply(['请先#绑定uid', segment.button([
{ text: "绑定UID", input: "#绑定uid" }, { text: "绑定UID", input: "#绑定uid" },
])]) ])], false, { at: true })
} }
if (!this.ckInfo.ck) { if (!this.ckInfo.ck) {