diff --git a/divent/__main__.py b/divent/__main__.py new file mode 100644 index 0000000..5b90231 --- /dev/null +++ b/divent/__main__.py @@ -0,0 +1,3 @@ +from divent.bot import run + +run() diff --git a/divent/bot.py b/divent/bot.py index 85baf9d..1f940e8 100644 --- a/divent/bot.py +++ b/divent/bot.py @@ -342,6 +342,6 @@ async def ical(entity_id: str): return redirect(url_for(".login")) -def __main__(): +def run(): client.loop.create_task(client.start(DISCORD_TOKEN)) app.run("0.0.0.0", loop=client.loop) diff --git a/pyproject.toml b/pyproject.toml index 4a4acda..5fd1d3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ homepage = "https://divent.crystalyx.net/" repository = "https://git.crystalyx.net/Xefir/Divent" [tool.poetry.scripts] -divent = 'divent.bot:__main__' +divent = 'divent.bot:run' [tool.poetry.dependencies] python = ">=3.8.1,<3.12"