Queer European MD passionate about IT
Pārlūkot izejas kodu

Show davtelepot version in /version command

Davte 5 gadi atpakaļ
vecāks
revīzija
76b7e50e52

+ 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.4.13"
+__version__ = "2.4.14"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 

+ 5 - 2
davtelepot/administration_tools.py

@@ -14,6 +14,7 @@ import datetime
 import json
 
 # Third party modules
+import davtelepot
 from davtelepot import messages
 from davtelepot.utilities import (
     async_wrapper, Confirmator, extract, get_cleaned_text, get_user,
@@ -786,12 +787,14 @@ async def _version_command(bot, update, user_record):
             stderr=asyncio.subprocess.STDOUT
         )
         stdout, _ = await _subprocess.communicate()
-        version = stdout.decode().strip()
+        last_commit = stdout.decode().strip()
+        davtelepot_version = davtelepot.__version__
     except Exception as e:
         return f"{e}"
     return bot.get_message(
         'admin', 'version_command', 'result',
-        version=version,
+        last_commit=last_commit,
+        davtelepot_version=davtelepot_version,
         update=update, user_record=user_record
     )
 

+ 4 - 2
davtelepot/messages.py

@@ -247,8 +247,10 @@ default_admin_messages = {
         },
         'help_section': None,
         'result': {
-            'en': "Last commit: {version}",
-            'it': "Ultimo commit: {version}",
+            'en': "Last commit: {last_commit}\n"
+                  "davtelepot version: {davtelepot_version}",
+            'it': "Ultimo commit: {last_commit}"
+                  "Version di davtelepot: {davtelepot_version}",
         },
     }
 }