调整喵喵角色的msg判定,必须以#开头

调整部分ck判定逻辑
This commit is contained in:
yoimiya-kokomi 2022-10-02 02:33:08 +08:00
parent 4a4fdd1664
commit f16f16dc9c
2 changed files with 5 additions and 7 deletions

View File

@ -43,7 +43,7 @@ export async function character (e) {
function checkCharacter (e) {
let msg = e.original_msg || e.msg
if (!msg) {
if (!msg || !/^#/.exec(msg)) {
return false
}

View File

@ -22,13 +22,11 @@ export default class MysApi {
return false
}
let uid = mys.uid
let ckUid = mys.ckInfo?.uid
/* 检查user ck */
if (auth === 'cookie') {
let isCookieUser = await MysInfo.checkUidBing(uid)
if (!isCookieUser || uid !== ckUid) {
e.reply('尚未绑定Cookie...')
return false
if (!mys.isSelf) {
e.reply('请绑定CK以使用此功能...')
return true
}
}
e._mys = new MysApi(e, uid, mys)
@ -47,7 +45,7 @@ export default class MysApi {
}
get isSelfCookie () {
return this.uid * 1 === this.ckUid * 1
return this.uid * 1 === this.ckUid * 1 || this.MysApi.isSelf
}
get ckUid () {