更新对e.game的处理逻辑
This commit is contained in:
parent
b4f9b54dbd
commit
ee33abc554
|
@ -181,12 +181,13 @@ class PluginsLoader {
|
|||
})
|
||||
/** 检查频道消息 */
|
||||
if (this.checkGuildMsg(e)) return
|
||||
/** 检查黑白名单 */
|
||||
if (!this.checkBlack(e)) return
|
||||
|
||||
/** 冷却 */
|
||||
if (!this.checkLimit(e)) return
|
||||
/** 处理消息 */
|
||||
this.dealMsg(e)
|
||||
/** 检查黑白名单 */
|
||||
if (!this.checkBlack(e)) return
|
||||
/** 处理回复 */
|
||||
this.reply(e)
|
||||
/** 过滤事件 */
|
||||
|
@ -233,8 +234,16 @@ class PluginsLoader {
|
|||
|
||||
// 判断是否是星铁命令,若是星铁命令则标准化处理
|
||||
// e.isSr = true,且命令标准化为 #星铁 开头
|
||||
Object.defineProperty(e, 'isSr', {
|
||||
get: () => e.game === 'sr',
|
||||
set: (v) => e.game = v ? 'sr' : 'gs'
|
||||
})
|
||||
Object.defineProperty(e, 'isGs', {
|
||||
get: () => e.game === 'gs',
|
||||
set: (v) => e.game = v ? 'gs' : 'sr'
|
||||
})
|
||||
if (this.srReg.test(e.msg)) {
|
||||
e.isSr = true
|
||||
e.game = 'sr'
|
||||
e.msg = e.msg.replace(this.srReg, '#星铁')
|
||||
}
|
||||
|
||||
|
@ -717,8 +726,13 @@ class PluginsLoader {
|
|||
if (e.test) return true
|
||||
|
||||
/** 黑名单qq */
|
||||
if (other.blackQQ && other.blackQQ.includes(Number(e.user_id) || e.user_id)) {
|
||||
return false
|
||||
if (other.blackQQ) {
|
||||
if (other.blackQQ.includes(Number(e.user_id) || e.user_id)) {
|
||||
return false
|
||||
}
|
||||
if (e.at && other.blackQQ.includes(Number(e.at) || e.at)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (e.group_id) {
|
||||
|
|
|
@ -77,7 +77,6 @@ export default class Runtime {
|
|||
await MysInfo.initCache()
|
||||
let runtime = new Runtime(e)
|
||||
e.runtime = runtime
|
||||
e.game = e.isSr ? 'sr' : 'gs'
|
||||
await runtime.initUser()
|
||||
return runtime
|
||||
}
|
||||
|
@ -88,7 +87,7 @@ export default class Runtime {
|
|||
if (user) {
|
||||
e.user = new Proxy(user, {
|
||||
get (self, key, receiver) {
|
||||
let game = e.isSr ? 'sr' : 'gs'
|
||||
let game = e.game
|
||||
let fnMap = {
|
||||
uid: 'getUid',
|
||||
uidList: 'getUidList',
|
||||
|
|
|
@ -13,7 +13,6 @@ fs.readFile(`${_path}/config/pm2/pm2.json`, `utf8`, (err, data) => {
|
|||
const config = JSON.parse(data)
|
||||
if (config.apps && config.apps.length > 0 && config.apps[0].name) {
|
||||
const appName = config.apps[0].name
|
||||
console.log(config.apps[0].name)
|
||||
runPm2Logs(appName)
|
||||
} else {
|
||||
console.log('读取失败:无法在pm2.json中找到name数组')
|
||||
|
@ -32,4 +31,4 @@ function runPm2Logs(appName) {
|
|||
console.error(`pm2 logs process exited with code ${code}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue