raito.plugins.roles.filter module

class raito.plugins.roles.filter.RoleFilter(slug, name, description, emoji)[исходный код]

Базовые классы: Filter

Filter for checking user roles.

This filter is used to verify whether the user associated with a Telegram event has a specific role assigned, such as «admin», «moderator», etc.

It also attaches role metadata to the handler’s flags for use in command registration and visualization logic.

Параметры:
classmethod from_data(data)[исходный код]

Create a RoleFilter from a RoleData instance.

Параметры:

data (RoleData) – RoleData instance containing role metadata

Результат:

A new RoleFilter instance

Тип результата:

RoleFilter

update_handler_flags(flags)[исходный код]

Attach role metadata to handler flags.

This allows external tools to collect and display role-related constraints.

Параметры:

flags (dict[str, Any])

Тип результата:

None