players.voice module

Provides functions specific to the player’s voice.

class players.voice._MuteManager[source]

Bases: collections.defaultdict

A singleton that manages muting players.

static _get_receivers(receivers)[source]

Return a tuple containing player indexes.

If <receivers> is None, a tuple is returned that contains all valid player indexes. Otherwise the given argument is returned after it has been validated.

is_muted(sender, receivers=None)[source]

Return True if a player is muted.

If <receivers> is None, it will be check if the players is muted for everyone.

If you want to check if the player is muted only for specific players, pass a tuple that contains the player indexes that should be checked.

mute_player(sender, receivers=None)[source]

Mute a player, so other players can’t hear him talking.

The muted player will still hear the other players.

If <receivers> is None, the sender will be muted for all players currently on the server and all future players.

If you want to mute the sender only for specific players, pass a tuple that contains the player indexes that shouldn’t hear the sender anymore.

unmute_player(sender, receivers=None)[source]

Unmute a player, so other players can hear him again.

If <receivers> is None, the sender will be unmuted for all players currently on the server and all future players.

If you want to unmute the sender only for specific players, pass a tuple that contains the player indexes that should hear the sender again.

players.voice.mute_manager

The singleton object of the _MuteManager class.