diff --git a/model.go b/model.go index c1d6930..66d722d 100644 --- a/model.go +++ b/model.go @@ -69,22 +69,22 @@ const ( ) type message struct { - Op string `json:"op"` - GuildID string `json:"guildId,omitempty"` - SessionID string `json:"sessionId,omitempty"` - Event VoiceServerUpdate `json:"event,omitempty"` - Track string `json:"track,omitempty"` - StartTime string `json:"startTime,omitempty"` - EndTime string `json:"endTime,omitempty"` - Pause bool `json:"pause,omitempty"` - Position int `json:"position,omitempty"` - Volume int `json:"volume,omitempty"` - State state `json:"state,omitempty"` - Type string `json:"type,omitempty"` - Reason string `json:"reason,omitempty"` - Error string `json:"error,omitempty"` - ThresholdMs int `json:"thresholdMs,omitempty"` - StatCPU statCPU `json:"cpu,omitempty"` + Op string `json:"op"` + GuildID string `json:"guildId,omitempty"` + SessionID string `json:"sessionId,omitempty"` + Event *VoiceServerUpdate `json:"event,omitempty"` + Track string `json:"track,omitempty"` + StartTime string `json:"startTime,omitempty"` + EndTime string `json:"endTime,omitempty"` + Pause bool `json:"pause,omitempty"` + Position int `json:"position,omitempty"` + Volume int `json:"volume,omitempty"` + State *state `json:"state,omitempty"` + Type string `json:"type,omitempty"` + Reason string `json:"reason,omitempty"` + Error string `json:"error,omitempty"` + ThresholdMs int `json:"thresholdMs,omitempty"` + StatCPU *statCPU `json:"cpu,omitempty"` // TODO: stats } diff --git a/node.go b/node.go index 44ee658..a0982c2 100644 --- a/node.go +++ b/node.go @@ -144,7 +144,7 @@ func (node *Node) CreatePlayer(guildID string, sessionID string, event VoiceServ Op: opVoiceUpdate, GuildID: guildID, SessionID: sessionID, - Event: event, + Event: &event, } data, err := json.Marshal(msg) if err != nil { diff --git a/player.go b/player.go index 485c4e6..9200dde 100644 --- a/player.go +++ b/player.go @@ -134,7 +134,7 @@ func (player *Player) Forward(sessionID string, event VoiceServerUpdate) error { Op: opVoiceUpdate, GuildID: player.guildID, SessionID: sessionID, - Event: event, + Event: &event, } data, err := json.Marshal(msg) if err != nil {