fix: pause, position, volume should be ptrs
prevents encoding/json from omitting these values when set to falsy real data (false, 0)
This commit is contained in:
parent
59811adafe
commit
746f26291f
6
model.go
6
model.go
|
@ -76,9 +76,9 @@ type message struct {
|
|||
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"`
|
||||
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"`
|
||||
|
|
|
@ -65,7 +65,7 @@ func (player *Player) Pause(pause bool) error {
|
|||
msg := message{
|
||||
Op: opPause,
|
||||
GuildID: player.guildID,
|
||||
Pause: pause,
|
||||
Pause: &pause,
|
||||
}
|
||||
data, err := json.Marshal(msg)
|
||||
if err != nil {
|
||||
|
@ -85,7 +85,7 @@ func (player *Player) Seek(position int) error {
|
|||
msg := message{
|
||||
Op: opSeek,
|
||||
GuildID: player.guildID,
|
||||
Position: position,
|
||||
Position: &position,
|
||||
}
|
||||
data, err := json.Marshal(msg)
|
||||
if err != nil {
|
||||
|
@ -111,7 +111,7 @@ func (player *Player) Volume(volume int) error {
|
|||
msg := message{
|
||||
Op: opVolume,
|
||||
GuildID: player.guildID,
|
||||
Volume: volume,
|
||||
Volume: &volume,
|
||||
}
|
||||
data, err := json.Marshal(msg)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue