Implement the chat notification for the player
This commit is contained in:
parent
b6ab0a229a
commit
bd301d69fb
1 changed files with 19 additions and 1 deletions
|
|
@ -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,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue