This repository was archived by the owner on Apr 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -204,23 +204,26 @@ async def disconnect(self):
204
204
self .channel_id = None
205
205
await self ._get_shard_socket (guild .shard_id ).voice_state (self .guild_id , None )
206
206
207
- async def play (self , track ):
207
+ async def play (self , track : Track , * , replace : bool = True ):
208
208
"""|coro|
209
209
210
210
Play a WaveLink Track.
211
211
212
212
Parameters
213
213
------------
214
214
track: :class:`Track`
215
- The :class:`Track` to initiate playing. If a song is already playing it will be stopped,
216
- and the new track will begin.
215
+ The :class:`Track` to initiate playing.
216
+ replace: bool
217
+ Whether or not the current track, if there is one, should be replaced or not. Defaults to True.
217
218
"""
218
219
self .last_update = 0
219
220
self .last_position = 0
220
221
self .position_timestamp = 0
221
222
self .paused = False
222
223
223
- await self .node ._send (op = 'play' , guildId = str (self .guild_id ), track = track .id )
224
+ no_replace = not replace
225
+
226
+ await self .node ._send (op = 'play' , guildId = str (self .guild_id ), track = track .id , noReplace = no_replace )
224
227
__log__ .debug (f'PLAYER | Started playing track:: { str (track )} ({ self .channel_id } )' )
225
228
self .current = track
226
229
You can’t perform that action at this time.
0 commit comments