From dff2cbbc7caab63b816604988de40488aee1e813 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sat, 20 Nov 2021 10:57:50 -0800 Subject: [PATCH] add minimal error check on config --- partybot/pnutbot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/partybot/pnutbot.py b/partybot/pnutbot.py index 13f9a6d..ddcdac2 100644 --- a/partybot/pnutbot.py +++ b/partybot/pnutbot.py @@ -397,6 +397,11 @@ def main(): Base.query = db_session.query_property() Base.metadata.create_all(bind=engine) + if len(config['ACCESS_TOKEN']) <= 1: + logger.error("Error, invalid access token") + logger.error(f"You may not have updated " + filename) + exit(-1) + pnutpy.api.add_authorization_token(config['ACCESS_TOKEN']) ws_url = "wss://stream.pnut.io/v1/user"