| 57 | } |
| 58 | |
| 59 | export function verifyRequiredEnvironmentVariables() { |
| 60 | // Required exist |
| 61 | [ |
| 62 | "TOKEN", |
| 63 | "CLIENT_ID", |
| 64 | "DEFAULT_COLOR", |
| 65 | ].forEach(name => { |
| 66 | if (process.env[name] == null) { |
| 67 | throw new Error(`Required environment variable ${name} not set. Please edit .env file`); |
| 68 | } |
| 69 | }); |
| 70 | // DEFAULT_COLOR is valid |
| 71 | if (!Object.keys(Color).includes(process.env.DEFAULT_COLOR as string)) { |
| 72 | throw new Error(`Invalid DEFAULT_COLOR value. Please edit .env file\nOptions: [${Object.keys(Color).join(", ")}]`); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | export async function checkForPatchNotes() { |
| 77 | // Check if any patch notes have not been read |