fix: log when no response
Some checks failed
Node.js CI / Lint and Test (push) Failing after 43s
Code Analysis / SonarQube (push) Failing after 1m1s

This commit is contained in:
Naomi Carrigan 2025-05-22 15:12:13 -07:00
parent e8e6b596ac
commit b6350fbc74
Signed by: naomi
SSH Key Fingerprint: SHA256:rca1iUI2OhAM6n4FIUaFcZcicmri0jgocqKiTTAfrt8

View File

@ -74,6 +74,10 @@ export const onMessage = async(message: Message): Promise<void> => {
response?.text ?? "There was an error. Please try again later.",
);
if (!response) {
await logger.log("info", `No response from AI, here's the payload: ${JSON.stringify(messages)}`);
}
await calculateCost(messages.usage, message.author.username);
} catch (error) {
await logger.error("message event", error as Error);