#dice roll is [object Promise]

1 messages · Page 1 of 1 (latest)

icy herald
#
const roll = new game.ffg.RollFFG(this.dicePool.renderDiceExpression(), this.roll.item, this.dicePool, this.roll.flavor);
await roll.toMessage({
          user: game.user.id,
          speaker: {
            actor: game.actors.get(this.roll.data?.actor?._id),
            alias: this.roll.data?.token?.name,
            token: this.roll.data?.token?._id,
          },
          flavor: `${game.i18n.localize("SWFFG.Rolling")} ${game.i18n.localize(this.roll.skillName)}...`,
        });

and then toMessage

    // Perform the roll, if it has not yet been rolled
    if (!this._evaluated) await this.evaluate();
    // other stuff
    // Either create the message or just return the chat data
    const cls = getDocumentClass("ChatMessage");
    const msg = new cls(messageData);
    if (rMode) msg.applyRollMode(rollMode);

    // Either create or return the data
    return create ? await cls.create(msg) : msg;
rapid vector
#

btw you can add syntax highlighting by adding the extension inline at the top like ```js

#

what's the context for this?

icy herald
#

initially it's a roll-builder, in the second block it's the (extended) roll object

rapid vector
#

I think your Promise.all needs to use Resolve

#

are you sure that this.terms is correct after that bit?

icy herald
#

relatively

rapid vector
#

could also be the part with this.results

icy herald
#

also looks correct

rapid vector
#

yeah you might want to use the proper browser debugger tools to step through things and figure out where it's weird

icy herald
#

I've stepped through it and, so far as I can tell, they are all resolved