From 67a018f897397abd8101930acd7688635deb5d5c Mon Sep 17 00:00:00 2001 From: c0de Date: Fri, 23 Sep 2022 21:40:51 -0500 Subject: [PATCH] Add the bot entrypoint --- GhostBallBot/main.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 GhostBallBot/main.py diff --git a/GhostBallBot/main.py b/GhostBallBot/main.py new file mode 100644 index 0000000..e2f21bb --- /dev/null +++ b/GhostBallBot/main.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# Copyright 2022 - c0de +# Licensed under the MIT License (https://opensource.org/licenses/MIT) + +import os +from pathlib import Path + +from .discord_client import client +from .database.models import DATABASE, database, create_models + +if __name__ == '__main__': + client = GhostBallClient() + client.run(os.environ.get('discord_token')) + + # Set up the database if we haven't already + if not os.path.exists(DATABASE): + database.connect() + create_models() + database.close()