From 1b4532e2cddea01cec0f0e929f86afcc69f00a5c Mon Sep 17 00:00:00 2001 From: Davte Date: Thu, 21 May 2020 15:32:04 +0200 Subject: [PATCH] Accept both updates and raw_updates in maintenance exception criteria --- davtelepot/__init__.py | 2 +- davtelepot/administration_tools.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index 87201a2..5c78525 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -11,7 +11,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.6.1" +__version__ = "2.6.2" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/administration_tools.py b/davtelepot/administration_tools.py index 7801be5..ecded83 100644 --- a/davtelepot/administration_tools.py +++ b/davtelepot/administration_tools.py @@ -789,9 +789,10 @@ def get_maintenance_exception_criterion(bot, allowed_command): """ def criterion(update): - if 'message' not in update: + if 'message' in update: + update = update['message'] + if 'text' not in update: return False - update = update['message'] text = get_cleaned_text(update, bot, []) if ( 'from' not in update