I have installed python-telegram-bot like this:
pip install python-telegram-bot
And when I’m trying to do this:
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
I get this error:
ImportError: cannot import name 'Filters' from 'telegram.ext' (/home/mobitnlh/virtualenv/db_application/3.8/lib/python3.8/site-packages/telegram/ext/__init__.py)
2
Answers
According to their wiki, the name is
filters
. So just replaceFilters
withfilters
:They made some changes, please see the link https://docs.python-telegram-bot.org/en/stable/telegram.ext.filters.html
Instead of
do
and instead of
Filters.all
dofilters.ALL
I hope it helps!