diff --git a/autowl/__main__.py b/autowl/__main__.py index b014ecc..b597726 100644 --- a/autowl/__main__.py +++ b/autowl/__main__.py @@ -1,16 +1,16 @@ -import os import discord +from os import environ +from sys import stderr # main runtime function def main(): - try: - disToken = os.environ['DISCORD_TOKEN'] # grabs the discord token from the environment variable, if not there, exit - except: - print("ERROR: unable to find discord token in environment variables!") + if disToken := environ.get('DISCORD_TOKEN'): + print(f"Received discord token: {disToken}") + # Call into main action here, basically launch the bot via import to a lower module + else: + print("Unable to access DISCORD_TOKEN in environment!", file=stderr) exit(1) - print("hello world") - main()