From 99c3756387f48aed6d37656eb25bfe2da16b1d95 Mon Sep 17 00:00:00 2001 From: HanaHimeUnica <860563585bxy@gmail.com> Date: Fri, 16 Feb 2024 00:08:08 +0800 Subject: [PATCH] =?UTF-8?q?*=E7=BB=91=E5=AE=9Auid=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/apps/user.js | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/plugins/genshin/apps/user.js b/plugins/genshin/apps/user.js index cc7c922..279990f 100644 --- a/plugins/genshin/apps/user.js +++ b/plugins/genshin/apps/user.js @@ -85,9 +85,15 @@ export class user extends plugin { return true } - if (this.e.msg == '#绑定uid') { - this.setContext('saveUid') - this.reply('请发送绑定的uid', false, { at: true }) + if (this.e.msg == "#绑定uid" || this.e.msg == "#绑定UID") { + this.setContext("saveUid") + this.reply("请发送绑定的原神uid", false, { at: true }) + return true + } + + if (this.e.msg == "#星铁绑定uid" || this.e.msg == "#星铁绑定UID") { + this.setContext("saveSrUid") + this.reply("请发送绑定的星铁uid", false, { at: true }) return true } } @@ -97,12 +103,27 @@ export class user extends plugin { if (!this.e.msg) return let uid = this.e.msg.match(/([1-9]|18)[0-9]{8}/g) if (!uid) { - this.reply('uid输入错误', false, { at: true }) + this.reply("原神UID输入错误", false, { at: true }) return } - this.e.msg = '#绑定' + this.e.msg + this.e.msg = "#绑定" + this.e.msg this.bingUid() - this.finish('saveUid') + this.finish("saveUid") + } + + /** 绑定星铁uid */ + saveSrUid() { + if (!this.e.msg) return + let uid = this.e.msg.match(/([1-9]|18)[0-9]{8}/g) + if (!uid) { + this.reply("星铁UID输入错误", false, { at: true }) + return + } + this.e.msg = "#星铁绑定" + this.e.msg + this.e.isSr = true + this.e.game = 'sr' + this.bingUid() + this.finish("saveSrUid") } /** 未登录ck */