diff --git a/structs.go b/structs.go index a7a4ef2..a51c0ac 100644 --- a/structs.go +++ b/structs.go @@ -265,6 +265,7 @@ type Event struct { Operation int `json:"op"` Direction int `json:"dir"` RawData json.RawMessage `json:"d"` + Struct interface{} `json:"-"` } // A Ready stores all data for the websocket READY event. diff --git a/wsapi.go b/wsapi.go index d5a6169..765b705 100644 --- a/wsapi.go +++ b/wsapi.go @@ -301,6 +301,8 @@ func (s *Session) event(messageType int, message []byte) { if i != nil { s.handle(i) } + + e.Struct = i s.handle(e) return