StarfallBot/app.py

33 lines
821 B
Python

import logging
import os
from threading import Thread
from starfall.config import Config
from starfall.log import Log
from starfall.web import App
if __name__ == "__main__":
Log.setup()
try:
Config.load()
except FileNotFoundError:
dst = Config.create()
logging.getLogger().critical(
msg="\n".join(
[
"*** Config file was not found ***",
"",
"Sample config.toml file has been created in the project's root directory:",
"[b]" + os.path.realpath("./%s" % dst) + "[/b]",
"Edit it and run the program again.",
]
),
extra={"markup": True},
)
exit()
App.__init__()
threads = [Thread(App.run())]