Skip to content

No control over dispatcher parameters when creating an Updater instance #1407

@Ambro17

Description

@Ambro17

Steps to reproduce

  1. Create an instance of the updater with updater = Updater('token')
  2. Try to control the instantiation of the asociated dispatcher object
  3. Fail becuase there's no way to control its instantiation. It always creates a dispatcher with the same non-configurable args

Expected behaviour

One should be able to control object creation either by extra kwargs or by passing a complete dispatcher instance.
My use case is adding a decorator factory method on Dispatcher Class, in order to decorate handler functions and automatically add them to the dispatcher handlers list. I have working code, but i would like to avoid forking the lib to use my extension

Actual behaviour

One has to edit lib code (dispatcher.py), or set atributes dinamically to extend dispatcher functionality

Configuration

Operating System:
Linux - Kubuntu 18 - KDE

Version of Python, python-telegram-bot & dependencies:

$ python -m telegram
python-telegram-bot 12.0.0b1 (v12.0.0b1-10-g2860318)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions