Skip to content

v1.16.11#5641

Merged
matiasb merged 2 commits intomainfrom
dev
Feb 11, 2026
Merged

v1.16.11#5641
matiasb merged 2 commits intomainfrom
dev

Conversation

@matiasb
Copy link
Contributor

@matiasb matiasb commented Feb 11, 2026

No description provided.

matiasb and others added 2 commits February 10, 2026 16:06
# What this PR does

Fix syntax for python-telegram-bot imports after upgrade to 20.0+
version

See release notes for [python-telegram-bot
20.0](https://docs.python-telegram-bot.org/en/v20.0/telegram.ext.filters.html)

>2. Removed the Filters class. The filters are now directly
attributes/classes of the
[filters](https://docs.python-telegram-bot.org/en/v21.7/telegram.ext.filters.html#module-telegram.ext.filters)
module.
>3. The names of all filters has been updated:
> - Filter classes which are ready for use, e.g Filters.all are now
capitalized, e.g filters.ALL.

> - Filters which need to be initialized are now in CamelCase. E.g.
filters.User(...).

> - Filters which do both (like Filters.text) are now split as
ready-to-use version filters.TEXT and class version filters.Text(...).

Without this change, the logs of the telegram‑polling container show the
following error:
```
ImportError: cannot import name 'Filters' from 'telegram.ext' (/usr/local/lib/python3.12/site-packages/telegram/ext/__init__.py). Did you mean: 'filters'?
```

Signed-off-by: ckaytev <anton-ckayt@mail.ru>
@matiasb matiasb requested a review from a team as a code owner February 11, 2026 18:58
@matiasb matiasb requested review from nokka and the-it and removed request for a team February 11, 2026 18:58
@matiasb matiasb merged commit a89716a into main Feb 11, 2026
51 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants