diff --git a/bots/discord/src/events/api/disconnect.ts b/bots/discord/src/events/api/disconnect.ts index 98a3c2c..f6306e5 100644 --- a/bots/discord/src/events/api/disconnect.ts +++ b/bots/discord/src/events/api/disconnect.ts @@ -18,7 +18,7 @@ on('disconnect', (reason, msg) => { // TODO: move to config if (api.disconnectCount >= 3) { - console.error(new Error('Disconnected from bot API too many times')) + console.error('Disconnected from bot API too many times') // We don't want the process hanging process.exit(1) } diff --git a/bots/discord/src/utils/discord/messageScan.ts b/bots/discord/src/utils/discord/messageScan.ts index b4d6d8e..eb45b09 100644 --- a/bots/discord/src/utils/discord/messageScan.ts +++ b/bots/discord/src/utils/discord/messageScan.ts @@ -54,6 +54,7 @@ export const getResponseFromContent = async ( // If none of the regexes match, we can search for labels immediately if (!response && !ocrMode) { + logger.debug('No match from before regexes, doing NLP') const scan = await api.client.parseText(content) if (scan.labels.length) { const matchedLabel = scan.labels[0]! @@ -82,7 +83,8 @@ export const getResponseFromContent = async ( } // If we still don't have a label, we can match all regexes after the initial label trigger - if (!response) + if (!response) { + logger.debug('No match from NLP, doing after regexes') for (let i = 0; i < config.responses.length; i++) { const { triggers, response: resp } = config.responses[i]! const firstLabelIndex = firstLabelIndexes[i] ?? -1 @@ -99,6 +101,7 @@ export const getResponseFromContent = async ( } } } + } return { response,