Skip to content

Commit

Permalink
Fix: node.players now returns a copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Dec 22, 2023
1 parent eb98c0a commit ad34914
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wavelink/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@ def status(self) -> NodeStatus:

@property
def players(self) -> dict[int, Player]:
"""A mapping of :attr:`discord.Guild.id` to :class:`~wavelink.Player`."""
return self._players
"""A mapping of :attr:`discord.Guild.id` to :class:`~wavelink.Player`.
.. versionchanged:: 3.2.0
This property now returns a shallow copy of the internal mapping.
"""
return self._players.copy()

@property
def client(self) -> discord.Client | None:
Expand Down

0 comments on commit ad34914

Please sign in to comment.