Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/queue redesign (New Queue implementation) #280

Merged
merged 8 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,7 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.vscode/
.vscode/

# Test
test.py
11 changes: 9 additions & 2 deletions wavelink/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ class Player(discord.VoiceProtocol):

Since the Player is a :class:`discord.VoiceProtocol`, it is attached to the various ``voice_client`` attributes
in discord.py, including ``guild.voice_client``, ``ctx.voice_client`` and ``interaction.voice_client``.

Attributes
----------
queue: :class:`~wavelink.Queue`
The queue associated with this player.
auto_queue: :class:`~wavelink.Queue`
The auto_queue associated with this player. This queue holds tracks that are recommended by the AutoPlay feature.
"""

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

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

# Probably don't need this here as it's likely to be cancelled instantly...
Expand Down Expand Up @@ -943,7 +950,7 @@ async def stop(self, *, force: bool = True) -> Playable | None:

.. versionchanged:: 3.0.0

This method is now known as ``skip``, but the alias ``stop`` has been kept for backwards compatability.
This method is now known as ``skip``, but the alias ``stop`` has been kept for backwards compatibility.
"""
return await self.skip(force=force)

Expand Down
Loading
Loading