From c69d0ff2cfcf9de0c162e27e75cb6f6a945c61bc Mon Sep 17 00:00:00 2001 From: ziro Date: Wed, 5 Aug 2020 10:53:17 +0700 Subject: + Tweaking --- zibot.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 zibot.py (limited to 'zibot.py') diff --git a/zibot.py b/zibot.py new file mode 100644 index 0000000..3b965d1 --- /dev/null +++ b/zibot.py @@ -0,0 +1,21 @@ +import asyncio +import json +from bot import ziBot + +def check_jsons(): + try: + f = open('config.json', 'r') + except FileNotFoundError: + token = input('Enter your bot\'s token: ') + with open('config.json', 'w+') as f: + json.dump({"token": token}, f, indent=4) + +def init_bot(): + bot = ziBot() + with open('config.json', 'r') as f: + data=json.load(f) + bot.run() + +if __name__ == "__main__": + check_jsons() + init_bot() -- cgit v1.2.3