Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit eeec649

Browse files
authored
Feature/queue redesign (New Queue implementation) (#280)
* New Queue implementation. * Add loaded property to Queue and other review changes.
1 parent 654215c commit eeec649

File tree

3 files changed

+464
-150
lines changed

3 files changed

+464
-150
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,7 @@ cython_debug/
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161161

162-
.vscode/
162+
.vscode/
163+
164+
# Test
165+
test.py

wavelink/player.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ class Player(discord.VoiceProtocol):
8383
8484
Since the Player is a :class:`discord.VoiceProtocol`, it is attached to the various ``voice_client`` attributes
8585
in discord.py, including ``guild.voice_client``, ``ctx.voice_client`` and ``interaction.voice_client``.
86+
87+
Attributes
88+
----------
89+
queue: :class:`~wavelink.Queue`
90+
The queue associated with this player.
91+
auto_queue: :class:`~wavelink.Queue`
92+
The auto_queue associated with this player. This queue holds tracks that are recommended by the AutoPlay feature.
8693
"""
8794

8895
channel: VocalGuildChannel
@@ -369,7 +376,7 @@ async def _search(query: str | None) -> T_a:
369376
track._recommended = True
370377
added += await self.auto_queue.put_wait(track)
371378

372-
random.shuffle(self.auto_queue._queue)
379+
random.shuffle(self.auto_queue._items)
373380
logger.debug(f'Player "{self.guild.id}" added "{added}" tracks to the auto_queue via AutoPlay.')
374381

375382
# Probably don't need this here as it's likely to be cancelled instantly...
@@ -943,7 +950,7 @@ async def stop(self, *, force: bool = True) -> Playable | None:
943950
944951
.. versionchanged:: 3.0.0
945952
946-
This method is now known as ``skip``, but the alias ``stop`` has been kept for backwards compatability.
953+
This method is now known as ``skip``, but the alias ``stop`` has been kept for backwards compatibility.
947954
"""
948955
return await self.skip(force=force)
949956

0 commit comments

Comments
 (0)