fix: error logging
Some checks failed
Node.js CI / Lint and Test (push) Failing after 44s
Code Analysis / SonarQube (push) Failing after 1m2s

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

View File

@ -14,6 +14,7 @@ import { personality } from "../config/personality.js";
import { ai } from "../utils/ai.js";
import { calculateCost } from "../utils/calculateCost.js";
import { isSubscribedMessage } from "../utils/isSubscribed.js";
import { logger } from "../utils/logger.js";
import type { MessageParam } from "@anthropic-ai/sdk/resources/index.js";
/**
@ -75,6 +76,7 @@ export const onMessage = async(message: Message): Promise<void> => {
await calculateCost(messages.usage, message.author.username);
} catch (error) {
await logger.error("message event", error as Error);
const button = new ButtonBuilder().
setLabel("Need help?").
setStyle(ButtonStyle.Link).