Remove debug line, add checks for env vars

This commit is contained in:
Firepup Sixfifty 2024-06-04 16:08:13 -05:00
parent b2151a373c
commit d6ec1f9251
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA

View file

@ -10,7 +10,9 @@ fp.replitCursor = fp.bcolors.REPLIT + ">>>" + fp.bcolors.RESET
load_dotenv() load_dotenv()
print(dir(fp)) for requiredVar in ["SLACK_BOT_TOKEN", "SLACK_APP_TOKEN"]:
if not os.environ.get(requiredVar):
raise ValueError(f'Missing required environment variable "{requiredVar}". Please create a .env file in the same directory as this script and define it.')
# Initializes your app with your bot token and socket mode handler # Initializes your app with your bot token and socket mode handler
app = App(token=os.environ.get("SLACK_BOT_TOKEN")) app = App(token=os.environ.get("SLACK_BOT_TOKEN"))