mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-26 09:07:43 +01:00
remove broadcaster argument from __init__
This commit is contained in:
parent
c7a1d8dca3
commit
88fbf3b5cf
1 changed files with 5 additions and 13 deletions
|
@ -41,24 +41,16 @@ class BotEventHandler:
|
|||
Args:
|
||||
token (str): The bots token given by the @BotFather
|
||||
base_url (Optional[str]):
|
||||
broadcaster (Optional[Broadcaster]): Use present Broadcaster object. If
|
||||
None, a new one will be created.
|
||||
workers (Optional[int]): Amount of threads in the thread pool for
|
||||
functions decorated with @run_async
|
||||
"""
|
||||
|
||||
def __init__(self, token, base_url=None, broadcaster=None, workers=4):
|
||||
|
||||
if broadcaster:
|
||||
self.bot = broadcaster.bot
|
||||
self.update_queue = broadcaster.update_queue
|
||||
self.broadcaster = broadcaster
|
||||
else:
|
||||
self.bot = Bot(token, base_url)
|
||||
self.update_queue = Queue()
|
||||
self.broadcaster = Broadcaster(self.bot, self.update_queue,
|
||||
workers=workers)
|
||||
def __init__(self, token, base_url=None, workers=4):
|
||||
|
||||
self.bot = Bot(token, base_url)
|
||||
self.update_queue = Queue()
|
||||
self.broadcaster = Broadcaster(self.bot, self.update_queue,
|
||||
workers=workers)
|
||||
self.last_update_id = 0
|
||||
self.logger = logging.getLogger(__name__)
|
||||
self.running = False
|
||||
|
|
Loading…
Reference in a new issue