Queer European MD passionate about IT
Browse Source

Allow running as webhook

Davte 4 years ago
parent
commit
e35bf55b53
2 changed files with 7 additions and 2 deletions
  1. 1 1
      ciclopibot/__init__.py
  2. 6 1
      ciclopibot/bot.py

+ 1 - 1
ciclopibot/__init__.py

@@ -3,6 +3,6 @@
 __author__ = "Davide Testa"
 __email__ = "davide@davte.it"
 __license__ = "GNU General Public License v3.0"
-__version__ = "1.0.5"
+__version__ = "1.0.6"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"

+ 6 - 1
ciclopibot/bot.py

@@ -70,6 +70,10 @@ if __name__ == '__main__':
         from .data.config import local_host, port
     except ImportError:
         local_host, port = '127.0.0.1', 3000
+    try:
+        from .data.config import hostname, certificate
+    except ImportError:
+        hostname, certificate = '', None
     log_file = f"{path}/data/{log_file_name}"
     errors_file = f"{path}/data/{errors_file_name}"
 
@@ -100,7 +104,8 @@ if __name__ == '__main__':
 
     # Instantiate bot
     bot = davtelepot.bot.Bot(token=bot_token,
-                             database_url='ciclopibot/data/ciclopi.db')
+                             database_url='ciclopibot/data/ciclopi.db',
+                             hostname=hostname, certificate=certificate)
     # Assign commands to bot
     bot.set_unknown_command_message(
         "Comando sconosciuto!\n"