Fix panic
This commit is contained in:
parent
042fb9a951
commit
8dd5993481
13
real_time.go
13
real_time.go
@ -134,8 +134,17 @@ func (r *PushSubscription) StartListening(context context.Context) {
|
|||||||
channel := msg.Channel()
|
channel := msg.Channel()
|
||||||
|
|
||||||
if strings.HasPrefix(channel, groupChannel) || strings.HasPrefix(channel, dmChannel) {
|
if strings.HasPrefix(channel, groupChannel) || strings.HasPrefix(channel, dmChannel) {
|
||||||
c := content.(map[string]interface{})["line"]
|
c, ok := content.(map[string]interface{})
|
||||||
d, _ := json.Marshal(c)
|
if !ok {
|
||||||
|
fmt.Println(content, "err")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
e, ok := c["line"]
|
||||||
|
if !ok {
|
||||||
|
fmt.Println(content, "err")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
d, _ := json.Marshal(e)
|
||||||
r.chatEvent(contentType, d)
|
r.chatEvent(contentType, d)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user