-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
34 lines (29 loc) · 902 Bytes
/
Copy pathconfig.py
File metadata and controls
34 lines (29 loc) · 902 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
29
30
31
32
33
from dotenv import load_dotenv
from os import environ
from pathlib import Path
BOT_TOKEN = ""
USER_ID = ""
MOVIE_SERIES_TOKEN = ""
GAME_TOKEN = ""
MOVIE_SERIES_BASE_URL = "https://www.omdbapi.com/"
GAME_BASE_URL = "https://api.rawg.io/api/games"
ANIME_BASE_URL = "https://graphql.anilist.co"
print("Checking .env file...")
if Path('.env').exists():
load_dotenv()
BOT_TOKEN = environ["TOKEN"]
USER_ID = environ["USER_ID"]
MOVIE_SERIES_TOKEN = environ["MOVIE_SERIES_KEY"]
GAME_TOKEN = environ["GAME_KEY"]
else:
print("\t.env file not found")
exit(1)
print("Checking json files...")
json_file_names = ['anime.json', 'game.json', 'movie.json', 'series.json']
for name in json_file_names:
path = Path("data/" + name)
if not path.exists():
path.touch()
print("\t", path, "not found, created a new one");
else:
print("\t", path, " found");