Skip to content

Commit

Permalink
bot: upgrade context based callbacks
Browse files Browse the repository at this point in the history
python-telegram-bot Version 12.0
https://git.io/fxJuV

Signed-off-by: Mr.Miss <[email protected]>
  • Loading branch information
MrMissx committed May 11, 2020
1 parent 3bcc82c commit 212c4ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion forwarder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
WORKERS = Config.WORKERS


updater = tg.Updater(API_KEY, workers=WORKERS)
updater = tg.Updater(API_KEY, use_context=True, workers=WORKERS)

dispatcher = updater.dispatcher

Expand Down
4 changes: 2 additions & 2 deletions forwarder/modules/auto_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def forward(bot: Bot, update: Update):

try:
FORWARD_HANDLER = MessageHandler(Filters.chat(FROM_CHATS) & ~Filters.status_update & ~Filters.command,
forward, channel_post_updates=True)
forward)

dispatcher.add_handler(FORWARD_HANDLER)

except ValueError: # When FROM_CHATS list is not set because user doesn't know chat id(s)
LOGGER.warn("I can't FORWARD_HANDLER because your FROM_CHATS list is empty.")
LOGGER.warn("I can't Forward because your FROM_CHATS list is empty.")

0 comments on commit 212c4ad

Please sign in to comment.