aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorMango0x45 <thomasvoss@live.com>2020-07-24 11:26:02 +0000
committerMango0x45 <thomasvoss@live.com>2020-07-24 11:26:02 +0000
commite2c62f007d5d847611d3cb23d2f4ed93e3f4e005 (patch)
tree8108577531751b63c5a55c0cc2ef9177189fccbc /main.py
parent9c25db2450db56dc06f3b01056afcb424184e3ff (diff)
downloadsteve-bot-e2c62f007d5d847611d3cb23d2f4ed93e3f4e005.tar
steve-bot-e2c62f007d5d847611d3cb23d2f4ed93e3f4e005.tar.gz
steve-bot-e2c62f007d5d847611d3cb23d2f4ed93e3f4e005.tar.bz2
steve-bot-e2c62f007d5d847611d3cb23d2f4ed93e3f4e005.tar.lz
steve-bot-e2c62f007d5d847611d3cb23d2f4ed93e3f4e005.tar.xz
steve-bot-e2c62f007d5d847611d3cb23d2f4ed93e3f4e005.tar.zst
steve-bot-e2c62f007d5d847611d3cb23d2f4ed93e3f4e005.zip
Non-existent jsons are now created on run
Diffstat (limited to 'main.py')
-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()