Add the bot entrypoint
This commit is contained in:
parent
04e1556d2d
commit
67a018f897
19
GhostBallBot/main.py
Normal file
19
GhostBallBot/main.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# Copyright 2022 - c0de <c0de@c0de.dev>
|
||||||
|
# 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()
|
Loading…
Reference in New Issue
Block a user