from modules.module_base import ModuleBase
import os.path
import subprocess
import platform

class ModuleVersion(ModuleBase):
    PATH = os.path.dirname(os.path.dirname(__file__))

    def __init__(self, bot):
        ModuleBase.__init__(self, bot)
        self.name = "ModuleVersion"

    def notify_command(self, message_id, from_attr, date, chat, commandName, commandStr):
        if commandName == "version":
            try:
                text = ""
                text += "Python version %s\n" % platform.python_version()
                text += subprocess.check_output(["git","remote", "-v"], cwd=self.PATH).decode("utf-8")
                text += subprocess.check_output(["git","log", "-1"], cwd=self.PATH).decode("utf-8")
                print(type(text))
                self.bot.sendMessage(text, chat["id"])
            except:
                self.bot.sendMessage("Error getting version", chat["id"])

    def get_commands(self):
        return [
            ("version", "Get bot version"),
        ]

@@ -523,16 +523,76 @@
 rsion()%0A
+                text += %22Running on %25s%5Cn%22 %25 platform.node()%0A
         
@@ -678,32 +678,32 @@
 decode(%22utf-8%22)%0A
-
                 
@@ -790,42 +790,8 @@
 8%22)%0A
-                print(type(text))%0A
     
@@ -861,16 +861,16 @@
 except:%0A
-
         
@@ -934,16 +934,94 @@
 t%5B%22id%22%5D)
+%0A                self.logger.exception(%22Error getting version%22, exc_info=True)
 %0A%0A    de

add host