From 309ea325fbedb18d8ad79e83178b0fc6b49ad02d Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 22 Jul 2022 18:02:15 -0500 Subject: [PATCH] fix: add sensible defaults if no config and no subject --- src/commands/train.ts | 2 +- src/helpers/env.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/train.ts b/src/commands/train.ts index 8263363..41b386c 100644 --- a/src/commands/train.ts +++ b/src/commands/train.ts @@ -66,7 +66,7 @@ export async function execute(interaction : CommandInteraction) { switch (subject) { case null: // categoryArray = ['BIOLOGY', 'PHYSICS', 'CHEMISTRY', 'EARTH AND SPACE', 'ASTRONOMY', 'MATH']; - categoryArray = configCategories.subjects; + categoryArray = configCategories.subjects || ['BIOLOGY', 'PHYSICS', 'CHEMISTRY', 'EARTH AND SPACE', 'ASTRONOMY', 'MATH']; break; case 'astro': case 'astronomy': diff --git a/src/helpers/env.ts b/src/helpers/env.ts index c521aa3..79f63b4 100644 --- a/src/helpers/env.ts +++ b/src/helpers/env.ts @@ -3,4 +3,4 @@ import 'dotenv/config'; export const clientId = process.env.CLIENT_ID || ''; export const testingGuild = process.env.TESTING_GUILD || ''; export const token = process.env.TOKEN || ''; -export const mongoUri = process.env.MONGO_URI = 'mongodb://mongo:27017/awesome'; +export const mongoUri = process.env.MONGO_URI = 'mongodb://mongo:27017/AWESOME';