Accept both updates and raw_updates in maintenance exception criteria

This commit is contained in:
Davte 2020-05-21 15:32:04 +02:00
parent 12cca835b9
commit 1b4532e2cd
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ __author__ = "Davide Testa"
__email__ = "davide@davte.it" __email__ = "davide@davte.it"
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
__license__ = "GNU General Public License v3.0" __license__ = "GNU General Public License v3.0"
__version__ = "2.6.1" __version__ = "2.6.2"
__maintainer__ = "Davide Testa" __maintainer__ = "Davide Testa"
__contact__ = "t.me/davte" __contact__ = "t.me/davte"

View File

@ -789,9 +789,10 @@ def get_maintenance_exception_criterion(bot, allowed_command):
""" """
def criterion(update): def criterion(update):
if 'message' not in update: if 'message' in update:
update = update['message']
if 'text' not in update:
return False return False
update = update['message']
text = get_cleaned_text(update, bot, []) text = get_cleaned_text(update, bot, [])
if ( if (
'from' not in update 'from' not in update