From bd301d69fb1e99017fd4151468bf32101847820d Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 8 Nov 2025 19:06:19 -0700 Subject: [PATCH] Implement the chat notification for the player --- module/sockets/createNotif.mjs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/module/sockets/createNotif.mjs b/module/sockets/createNotif.mjs index 55b72a1..8ec4c2f 100644 --- a/module/sockets/createNotif.mjs +++ b/module/sockets/createNotif.mjs @@ -1 +1,19 @@ -export function createNotif() {}; +export function createNotif(payload) { + const { userID, content, includeGM } = payload; + + if (userID !== game.user.id) { return }; + + // TODO: prevent this from working if the user hasn't submitted a query response + + let whisper = [game.user.id]; + if (includeGM) { + whisper = game.users.filter(u => u.isGM).map(u => u.id); + }; + + ChatMessage.implementation.create({ + flavor: `Data Query Notification`, + content, + whisper, + style: CONST.CHAT_MESSAGE_STYLES.OOC, + }); +};