filters.players module

Provides player filtering functionality.

class filters.players.PlayerIter(is_filters=None, not_filters=None)[source]

Bases: filters.iterator._IterObject

Player iterate class.

static iterator()[source]

Iterate over all players.entity.Player objects.

_filters = {'all': <function <lambda>>, 'bot': <function <lambda>>, 'human': <function <lambda>>, 'alive': <function <lambda>>, 'dead': <function <lambda>>, 'un': <bound method _Team._player_is_on_team of <filters.players._Team object>>, 'spec': <bound method _Team._player_is_on_team of <filters.players._Team object>>, 't': <bound method _Team._player_is_on_team of <filters.players._Team object>>, 'ct': <bound method _Team._player_is_on_team of <filters.players._Team object>>}

Return the default filters (all available filters).

filters.players.parse_filter(expr, filters=None)[source]

Parse an expression and return a set containing Player objects.

  • expr (str) – The expression to parse.
  • filters (dict) – Filters that should be used instead of the default filters. All filter names must be lowercase.
Return type:


  • SyntaxError – Raised if the expression is invalid.
  • KeyError – Raised if an invalid filter was used.
  • ValueError – Raised if the conversion from userid to index failed.