Move the query event handlers into a subfolder and name them in a consistent way

This commit is contained in:
Oliver 2025-11-20 22:14:43 -07:00
parent 6a2cc1170d
commit c113c326c6
6 changed files with 38 additions and 32 deletions

View file

@ -0,0 +1,24 @@
import { respondedToQueries } from "../../utils/QueryManager.mjs";
export function queryNotify(payload) {
const { id, userID, content, includeGM } = payload;
if (userID !== game.user.id) { return };
// Ensure that each user can only get one notification about a query
if (!respondedToQueries.has(id)) { return };
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,
});
respondedToQueries.delete(id);
};