def __init__(self, bot):
self.bot = bot
self.dota_settings = fileIO("data/dota/settings.json", "load")
# Check for key either in settings or in ENV
if "key" in self.dota_settings.keys() and self.dota_settings["key"] != "":
# If exists in setting and is set
api.set_api_key(self.dota_settings["key"])
self.key = True
elif os.environ.get("DOTA2_API_KEY") is not None:
# If exists in env vars and is set
api.set_api_key(os.environ.get("DOTA2_API_KEY"))
self.key = True
else:
self.key = False
评论列表
文章目录