python-telegram-bot/ptbcontrib

[QUESTION] ptb_sqlalchemy_jobstore ptb>20

jekeam opened this issue · 5 comments

Module this question is about

ptb_sqlalchemy_jobstore

Issue I am facing

How do I adapt this for python-telegram-bot 20.0a4?

And if so, how should I change the code:

updater = Updater("TOKEN")
dispatcher = updater.dispatcher
dispatcher.job_queue.scheduler.add_jobstore(
   PTBSQLAlchemyJobStore(
       dispatcher=dispatcher, url=DB_URI,
    ),
)

Traceback to the issue

Traceback (most recent call last):
  File "E:\YandexDisk\github\namaz_bot\main.py", line 26, in <module>
    from ptbcontrib.ptb_sqlalchemy_jobstore import PTBSQLAlchemyJobStore
  File "E:\YandexDisk\github\namaz_bot\venv\lib\site-packages\ptbcontrib\ptb_sqlalchemy_jobstore\__init__.py", line 18, in <module>
    from .jobstore import PTBSQLAlchemyJobStore
  File "E:\YandexDisk\github\namaz_bot\venv\lib\site-packages\ptbcontrib\ptb_sqlalchemy_jobstore\jobstore.py", line 27, in <module>
    from telegram.ext import CallbackContext, Dispatcher
ImportError: cannot import name 'Dispatcher' from 'telegram.ext' (E:\YandexDisk\github\namaz_bot\venv\lib\site-packages\telegram\ext\__init__.py)

Related part of your code

Python 3.9, python-telegram-bot==20.0a4

Hi. PTBSQLAlchemyJobStore has not yet been upgraded to be compatible with v20.x.

Hi. PTBSQLAlchemyJobStore has not yet been upgraded to be compatible with v20.x.

When the update is planned and are there any options for solving the problem?

PTBSQLAlchemyJobStore will be updated once someone sits down and actually does the coding - we don't have any timeline for ptbcontrib

If you want to solve it, you can also just go ahead and code the update. That's the beauty of open source.

Closing in respect of #62