Queer European MD passionate about IT
瀏覽代碼

/select command implemented

It calls _query_command function
Davte 5 年之前
父節點
當前提交
1297402357
共有 2 個文件被更改,包括 15 次插入1 次删除
  1. 1 1
      davtelepot/__init__.py
  2. 14 0
      davtelepot/administration_tools.py

+ 1 - 1
davtelepot/__init__.py

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

+ 14 - 0
davtelepot/administration_tools.py

@@ -603,6 +603,14 @@ default_admin_messages = {
             'it': "Risultato della query"
         }
     },
+    'select_command': {
+        'description': {
+            'en': "Receive the result of a SELECT query performed on bot "
+                  "database",
+            'it': "Ricevi il risultato di una query SQL di tipo SELECT "
+                  "sul database del bot"
+        }
+    },
     'query_button': {
         'error': {
             'en': "Error!",
@@ -973,6 +981,12 @@ def init(bot, talk_messages=None, admin_messages=None):
     async def query_command(bot, update, user_record):
         return await _query_command(bot, update, user_record)
 
+    @bot.command(command='/select', aliases=[], show_in_keyboard=False,
+                 description=admin_messages['select_command']['description'],
+                 authorization_level='admin')
+    async def select_command(bot, update, user_record):
+        return await _query_command(bot, update, user_record)
+
     @bot.button(prefix='db_query:///', separator='|',
                 description=admin_messages['query_command']['description'],
                 authorization_level='admin')