Queer European MD passionate about IT
Browse Source

Accept both updates and raw_updates in maintenance exception criteria

Davte 3 years ago
parent
commit
1b4532e2cd
2 changed files with 4 additions and 3 deletions
  1. 1 1
      davtelepot/__init__.py
  2. 3 2
      davtelepot/administration_tools.py

+ 1 - 1
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"
 

+ 3 - 2
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