Allow running as webhook

This commit is contained in:
Davte 2019-07-20 13:52:06 +02:00
parent 18ff1ad84e
commit e35bf55b53
2 changed files with 7 additions and 2 deletions

View File

@ -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"

View File

@ -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"