From 9fdf3a3f10c2f6c924f18a89cdac350af5a243f0 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Fri, 27 Mar 2026 14:26:48 -0400 Subject: [PATCH] starting in on rolls --- scripts/claude-gm.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/claude-gm.js b/scripts/claude-gm.js index 121b40b..fe8a314 100644 --- a/scripts/claude-gm.js +++ b/scripts/claude-gm.js @@ -17,13 +17,16 @@ function formatResponse(text) { .replace(/^(.*)$/, "

$1

"); } -Hooks.on("createChatMessage", async (message, options, userId) => { - if (message.speaker.alias === 'AI DM') return +Hooks.on("createChatMessage", async (chatData, options, userId) => { + console.log(chatData); + if (chatData.speaker?.alias === 'AI DM' || chatData.isRoll) return +}) +Hooks.on("chatMessage", async (chatLog, message, chatData) => { const response = await fetch('https://ai-dm-api.artisan.al/prompt', { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ content:message.content }) + body: JSON.stringify({ content:message }) }); const data = await response.json(); console.log(data); @@ -32,6 +35,7 @@ Hooks.on("createChatMessage", async (message, options, userId) => { speaker: { alias: 'AI DM'}, style: CONST.CHAT_MESSAGE_STYLES.IC }); + }) Hooks.once("ready", () => { console.log('Claude listening...');