My discord.py bot is not starting because of a KeyError

It seems to me that the problem lies in reading from the config file in main at lines 6-13. Make sure that in config.json you have all the variables you're trying to get and it gets them correctly.