Add proper error handling.

This commit is contained in:
zkldi
2022-03-21 19:17:46 +00:00
parent 7286884051
commit e17ef89d72
+6 -1
View File
@@ -25,7 +25,12 @@ const command: SlashCommand = {
return `Invalid userID. Can't query this!`;
}
const userDoc = await GetUserInfo(userID);
let userDoc;
try {
userDoc = await GetUserInfo(userID);
} catch (err) {
return `This user does not exist.`;
}
const { game, playtype } = ParseGPT(interaction.options.getString("game", true));