mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 12:25:45 +01:00
lazily load all of telegram.ext
This commit is contained in:
parent
45a47d54bd
commit
c43b348117
1 changed files with 25 additions and 1 deletions
|
@ -52,7 +52,9 @@ from .bot import Bot
|
|||
|
||||
|
||||
def Updater(*args, **kwargs):
|
||||
"""Load the updater module on invocation and return an Updater instance."""
|
||||
"""
|
||||
Load the updater module on invocation and return an Updater instance.
|
||||
"""
|
||||
import warnings
|
||||
warnings.warn("telegram.Updater is being deprecated, please use "
|
||||
"telegram.ext.Updater from now on.")
|
||||
|
@ -60,6 +62,28 @@ def Updater(*args, **kwargs):
|
|||
return Up(*args, **kwargs)
|
||||
|
||||
|
||||
def Dispatcher(*args, **kwargs):
|
||||
"""
|
||||
Load the dispatcher module on invocation and return an Dispatcher instance.
|
||||
"""
|
||||
import warnings
|
||||
warnings.warn("telegram.Dispatcher is being deprecated, please use "
|
||||
"telegram.ext.Dispatcher from now on.")
|
||||
from .ext.dispatcher import Dispatcher as Dis
|
||||
return Dis(*args, **kwargs)
|
||||
|
||||
|
||||
def JobQueue(*args, **kwargs):
|
||||
"""
|
||||
Load the jobqueue module on invocation and return a JobQueue instance.
|
||||
"""
|
||||
import warnings
|
||||
warnings.warn("telegram.JobQueue is being deprecated, please use "
|
||||
"telegram.ext.JobQueue from now on.")
|
||||
from .ext.jobqueue import JobQueue as JobQ
|
||||
return JobQ(*args, **kwargs)
|
||||
|
||||
|
||||
__author__ = 'devs@python-telegram-bot.org'
|
||||
__version__ = '3.3'
|
||||
__all__ = ('Audio', 'Bot', 'Chat', 'Emoji', 'TelegramError', 'InputFile',
|
||||
|
|
Loading…
Add table
Reference in a new issue