You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: IMPLEMENTATION.md
+51-16Lines changed: 51 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,11 @@ User-Id: The user id of the bot you are playing music with
46
46
```
47
47
48
48
### Outgoing messages
49
+
50
+
#### Provide a voice server update
51
+
49
52
Provide an intercepted voice server update. This causes the server to connect to the voice channel.
53
+
50
54
```json
51
55
{
52
56
"op": "voiceUpdate",
@@ -56,13 +60,17 @@ Provide an intercepted voice server update. This causes the server to connect to
56
60
}
57
61
```
58
62
59
-
Cause the player to play a track.
63
+
#### Play a track
60
64
61
65
`startTime` is an optional setting that determines the number of milliseconds to offset the track by. Defaults to 0.
62
66
63
67
`endTime` is an optional setting that determines at the number of milliseconds at which point the track should stop playing. Helpful if you only want to play a snippet of a bigger track. By default the track plays until it's end as per the encoded data.
64
68
65
-
If `noReplace` is set to true, this operation will be ignored if a track is already playing or paused.
69
+
`volume` is an optional setting which changes the volume if provided.
70
+
71
+
If `noReplace` is set to true, this operation will be ignored if a track is already playing or paused. This is an optional field.
72
+
73
+
If `pause` is set to true, the playback will be paused. This is an optional field.
66
74
67
75
```json
68
76
{
@@ -71,19 +79,23 @@ If `noReplace` is set to true, this operation will be ignored if a track is alre
71
79
"track": "...",
72
80
"startTime": "60000",
73
81
"endTime": "120000",
74
-
"noReplace": false
82
+
"volume": "100",
83
+
"noReplace": false,
84
+
"pause": false,
75
85
}
76
86
```
77
87
78
-
Cause the player to stop
88
+
#### Stop a player
89
+
79
90
```json
80
91
{
81
92
"op": "stop",
82
93
"guildId": "..."
83
94
}
84
95
```
85
96
86
-
Set player pause
97
+
#### Pause the playback
98
+
87
99
```json
88
100
{
89
101
"op": "pause",
@@ -92,7 +104,10 @@ Set player pause
92
104
}
93
105
```
94
106
95
-
Make the player seek to a position of the track. Position is in millis
107
+
#### Seek a track
108
+
109
+
The position is in milliseconds.
110
+
96
111
```json
97
112
{
98
113
"op": "seek",
@@ -101,7 +116,10 @@ Make the player seek to a position of the track. Position is in millis
101
116
}
102
117
```
103
118
104
-
Set player volume. Volume may range from 0 to 1000. 100 is default.
119
+
#### Set player volume
120
+
121
+
Volume may range from 0 to 1000. 100 is default.
122
+
105
123
```json
106
124
{
107
125
"op": "volume",
@@ -110,7 +128,13 @@ Set player volume. Volume may range from 0 to 1000. 100 is default.
110
128
}
111
129
```
112
130
113
-
Using the player equalizer
131
+
#### Using the player equalizer
132
+
133
+
There are 15 bands (0-14) that can be changed.
134
+
`gain` is the multiplier for the given band. The default value is 0. Valid values range from -0.25 to 1.0,
135
+
where -0.25 means the given band is completely muted, and 0.25 means it is doubled. Modifying the gain could
136
+
also change the volume of the output.
137
+
114
138
```json
115
139
{
116
140
"op": "equalizer",
@@ -123,14 +147,13 @@ Using the player equalizer
123
147
]
124
148
}
125
149
```
126
-
There are 15 bands (0-14) that can be changed.
127
-
`gain` is the multiplier for the given band. The default value is 0. Valid values range from -0.25 to 1.0,
128
-
where -0.25 means the given band is completely muted, and 0.25 means it is doubled. Modifying the gain could
129
-
also change the volume of the output.
150
+
151
+
#### Destroy a player
130
152
131
153
Tell the server to potentially disconnect from the voice server and potentially remove the player with all its data.
132
154
This is useful if you want to move to a new node for a voice connection. Calling this op does not affect voice state,
133
155
and you can send the same VOICE_SERVER_UPDATE to a new node.
156
+
134
157
```json
135
158
{
136
159
"op": "destroy",
@@ -203,7 +226,7 @@ Server emitted an event. See the client implementation below.
203
226
* 2. TrackEndEvent
204
227
* 3. TrackExceptionEvent
205
228
* 4. TrackStuckEvent
206
-
* <p>
229
+
*
207
230
* The remaining lavaplayer events are caused by client actions, and are therefore not forwarded via WS.
0 commit comments