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

Commit ad34914

Browse files
committed
Fix: node.players now returns a copy.
1 parent eb98c0a commit ad34914

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

wavelink/node.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,14 @@ def status(self) -> NodeStatus:
207207

208208
@property
209209
def players(self) -> dict[int, Player]:
210-
"""A mapping of :attr:`discord.Guild.id` to :class:`~wavelink.Player`."""
211-
return self._players
210+
"""A mapping of :attr:`discord.Guild.id` to :class:`~wavelink.Player`.
211+
212+
213+
.. versionchanged:: 3.2.0
214+
215+
This property now returns a shallow copy of the internal mapping.
216+
"""
217+
return self._players.copy()
212218

213219
@property
214220
def client(self) -> discord.Client | None:

0 commit comments

Comments
 (0)