Learn-Build-Teach / learn-build-teach-discord-bot

53 stars 17 forks source link

Updated env vars to allow app to start with incomplete set #78

Closed nikfp closed 1 year ago

nikfp commented 1 year ago

This PR updated the variables.ts file to allow the app to start with an incomplete set of vars. The core vars for interaction (supabase, discord) are still required, but the code for the rest has been updated to warn the maintainer and log missing vars but allow startup to commence.

Also included is an update to the email.ts that checks for the env var before setting the API key, preventing an error.

The shape of the env vars interface has also been updated to reflect the possibility of certain keys being undefined at runtime.

No linting errors found and formatting has been done, please comment on any further changes needed for structure or code style.

EDIT updated to reflect changes from the discord bot rewrite for automatic scheduling of events. This now reflects current code for variables.ts but keeps the update to email.ts to ensure app will load without the sendgrid API key

jamesqquick commented 1 year ago

Thanks for contributing @nikfp !!!