Abstract#

class harmonize.abstract.Filter(values: T, plugin_filter: bool = False)[source]#

Basic class of filters

Note

This class can be used if additional filters are used that are not implemented

Operations#

x == y

Checks if two filters are the same.

x != y

Checks if two filters are not the same.

hash(x)

Return the filter’s hash.

values#

Values Needed Lavalink. See harmonize.objects.ChannelMix for example

Type:

TypeVar (dict[str, any], list[float], list[int], floa)

plugin_filter#

A flag indicating whether the filter is a plugin filter. Default is False.

Type:

bool

abstract update(**kwargs) None[source]#

Update the filter with new parameters.

Parameters:

kwargs (dict) – Keyword arguments representing the new parameters for the filter.

Raises:

NotImplementedError – If the method is not implemented in a subclass.

Return type:

None

abstract to_dict() dict[str, T][source]#

Convert the filter to a dictionary representation.

Returns:

A dictionary representation of the filter.

Return type:

dict[str, T]

Raises:

NotImplementedError – If the method is not implemented in a subclass.

class harmonize.abstract.Serializable[source]#

Abstract base class for objects that can be serialized and deserialized.

classmethod from_dict(data: dict) Serializable[source]#

Creates and returns a new instance of the class from the given dictionary data.

Parameters:

data (dict) – A dictionary containing the data to initialize the new instance.

Returns:

A new instance of the class initialized with the given data.

Return type:

Serializable

Raises:

NotImplementedError – If the method is not implemented in a subclass.