getRandomBookOfType() will throw this exception if there is no books for the passed type in the database
/app/src/utils/postgresConnections.ts:5
import { BOOK, BOOK_TYPES, PROMPT as PROMPT_TYPE, DB_CONSTANTS, GUILD } from "../dbConstants/dbConstants";
TypeError: Cannot destructure property 'id' of 'randomSelection(...)' as it is undefined.
at /app/src/utils/postgresConnections.ts:87:13
at Generator.next (<anonymous>)
at fulfilled (/app/src/utils/postgresConnections.ts:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
getRandomBookOfType()
will throw this exception if there is no books for the passed type in the databaseThe culprit is this line