aboutsummaryrefslogtreecommitdiff
path: root/zibot.py
blob: 2e0c3e02e304a667ad9957fc2a6a918b29d8c12f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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.remove_command('help')
    bot.run()

if __name__ == "__main__":
    check_jsons()
    init_bot()