[BUG] - Sending an active effect to chat doesnt work (#727)

Fixes #616

Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
This commit is contained in:
joaquinpereyra98 2025-08-08 18:32:32 -03:00 committed by GitHub
parent 45b3569cba
commit 85982bac8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 33 additions and 34 deletions

View file

@ -124,15 +124,20 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
return tags;
}
/**
* Create a new ChatMessage to display this documents data.
* @param {String} origin - uuid of a document. TODO: This needs to be reviewed.
*/
async toChat(origin) {
/**@type {foundry.documents.ChatMessage} */
const cls = getDocumentClass('ChatMessage');
const actor = game.actors.get(cls.getSpeaker().actor);
const speaker = cls.getSpeaker();
const actor = cls.getSpeakerActor(speaker);
const systemData = {
action: { img: this.img, name: this.name },
actor: { name: actor.name, img: actor.img },
author: this.author,
speaker: cls.getSpeaker(),
origin: origin,
actor: { name: actor?.name, img: actor?.img },
speaker,
origin,
description: this.description,
actions: []
};