-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (22 loc) · 751 Bytes
/
main.py
File metadata and controls
28 lines (22 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import json
import logging
import coloredlogs
from hereby import Here
from models.cog import CommandCog
from models.client import BachelorOverTelecom
if __name__ == "__main__":
here = Here(__file__)
coloredlogs.install()
logging.basicConfig(
level=logging.INFO,
)
with open(here.abspath(".env.json")) as key:
ENVIRONMENT = json.load(key)
API_KEY = ENVIRONMENT.get("API_KEY", None)
if API_KEY is None:
logging.error("No API key found ! quitting")
else:
client = BachelorOverTelecom.get_instance()
client.add_cog(CommandCog(ENVIRONMENT=ENVIRONMENT))
logging.info(f"Starting application with env vars: {', '.join(ENVIRONMENT.keys())}")
client.run(API_KEY)