From c8da4f497764e282934f992d932168b75c3b2b47 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Thu, 26 Mar 2026 21:15:02 -0400 Subject: [PATCH] using createChatMessage hook --- scripts/claude-gm.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/claude-gm.js b/scripts/claude-gm.js index ad8073e..121b40b 100644 --- a/scripts/claude-gm.js +++ b/scripts/claude-gm.js @@ -17,14 +17,13 @@ function formatResponse(text) { .replace(/^(.*)$/, "

$1

"); } -Hooks.on("chatMessage", async (chatLog, message, chatData) => { - console.log(chatData); - console.log(message); +Hooks.on("createChatMessage", async (message, options, userId) => { + if (message.speaker.alias === 'AI DM') return + const response = await fetch('https://ai-dm-api.artisan.al/prompt', { - //const response = await fetch('http://debianmacbookair:3000/prompt', { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ message }) + body: JSON.stringify({ content:message.content }) }); const data = await response.json(); console.log(data);