Skip to content

v14-Filters: CamelCase vs SCREAMING_SNAIL_CASE #2907

@Bibo-Joshi

Description

@Bibo-Joshi

After a bit internal discussion, we came up with the following naming rule:

  • For simple cases, we have filters.CamelCase as filter class that needs to be initialized by the user and if applicable filters.CAMEL_CASE with a pre-instantiated shortcut
  • For cases where we have some kind of "nested" logic, i.e. subfilters that should be carried in the same namespace, we do something like filters.CamelCase.{ALL, SUP_TYPE_1, SUP_TYPE_2}. In this case filters.CamelCase may even be just a pure namespace class, i.e. not a subclass of BaseFilter

Accordingly, filters.DOCUMENT should be moved to filters.Document.ALL.

Additionally, filters.STICKER should be replaced by filters.Sticker.{ALL, ANIMATED, STATIC, VIDEO} with filters.Sticker being a pure namespace class.

It may be worth squashing this into the first filters-refactor commit on the v14 branch …

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions