mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
fix: don't listenAPI in Event connection
bug introduced by last commit
This commit is contained in:
parent
dba2bf2881
commit
c478870870
@ -162,7 +162,9 @@ func (c *websocketClient) connect(typ, url string, conptr **wsConn) {
|
|||||||
*conptr = wrappedConn
|
*conptr = wrappedConn
|
||||||
}
|
}
|
||||||
|
|
||||||
go c.listenAPI(typ, url, wrappedConn)
|
if typ != "Event" {
|
||||||
|
go c.listenAPI(typ, url, wrappedConn)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *websocketClient) listenAPI(typ, url string, conn *wsConn) {
|
func (c *websocketClient) listenAPI(typ, url string, conn *wsConn) {
|
||||||
@ -347,8 +349,8 @@ func (c *wsConn) handleRequest(_ *coolq.CQBot, payload []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *webSocketServer) onBotPushEvent(e *coolq.Event) {
|
func (s *webSocketServer) onBotPushEvent(e *coolq.Event) {
|
||||||
filter := filter.Find(s.filter)
|
flt := filter.Find(s.filter)
|
||||||
if filter != nil && !filter.Eval(gjson.Parse(e.JSONString())) {
|
if flt != nil && !flt.Eval(gjson.Parse(e.JSONString())) {
|
||||||
log.Debugf("上报Event %s 到 WS客户端 时被过滤.", e.JSONBytes())
|
log.Debugf("上报Event %s 到 WS客户端 时被过滤.", e.JSONBytes())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user