aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmain.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/main.py b/main.py
index 13bc0f0..28b58ab 100755
--- a/main.py
+++ b/main.py
@@ -6,6 +6,26 @@ from colorama import init as init_colorama
from bot import BedrockBot
+def check_jsons():
+ try:
+ f = open('config.json', 'r')
+ except FileNotFoundError:
+ token = input('BOT SETUP - Enter bot token: ')
+ with open('config.json', 'w+') as f:
+ json.dump({"token": token}, f, indent=4)
+
+ try:
+ f = open('blacklist.json', 'r')
+ except FileNotFoundError:
+ with open('blacklist.json', 'w+') as f:
+ json.dump([], f, indent=4)
+
+ try:
+ f = open('video_blacklist.json', 'r')
+ except FileNotFoundError:
+ with open('video_blacklist.json', 'w+') as f:
+ json.dump([], f, indent=4)
+
def setup_logging():
FORMAT = '%(asctime)s - [%(levelname)s]: %(message)s'
DATE_FORMAT = '%d/%m/%Y (%H:%M:%S)'
@@ -34,4 +54,6 @@ if __name__ == "__main__":
setup_logging()
+ check_jsons()
+
run_bot()