Construct a SohlSpeaker instance, resolving the token, actor, scene, user and display name from the supplied ids.
Speaker source data.
The roll mode to use.
The user ID.
The token ID; requires an initialized canvas.
The actor ID; used only when no token is provided.
The scene ID.
The explicit display name, overriding all resolved names.
Optional ReadonlyactorThe resolved actor (from the token or directly), or null.
ReadonlynameThe display name/alias used for attribution.
ReadonlyrollThe roll mode applied to messages this speaker posts.
Optional ReadonlysceneThe resolved scene, or null.
Optional ReadonlytokenThe resolved token, or null.
Optional ReadonlyuserThe resolved user (defaults to the current user), or null.
Whether the current user owns the speaker's token (or actor).
Build Foundry's ChatMessage speaker data from this speaker.
The chat message speaker data (alias and resolved ids).
Post a chat message attributed to this speaker.
The input is dispatched by type: a FilePath is rendered as a
Handlebars template, while an HTMLString is used as inline
content. The speaker's roll mode is applied automatically.
A template path or inline HTML content.
Optionaldata: PlainObjectTemplate context data — forwarded to the template or content renderer without property access.
Optionaloptions: PlainObjectChat options; see SohlSpeaker.ChatOptions for supported fields.
The created ChatMessage, or undefined if none was created.
Identifies who is speaking/acting and renders that voice to chat.
A
SohlSpeakerresolves a loose set of identifiers (token, actor, scene, user ids, or an explicit alias) into the concrete documents an action needs, and knows how to emit chat messages attributed to that speaker. Every sohl.entity.action.SohlActionContext holds one as itsspeaker, so it is the backbone of action output: results, dialogs, and roll cards are all posted through a speaker.Resolution rules applied at construction:
actorbecomes the speaker's actor when present;rollModesetting, then to the system default;alias, token name, actor name, the user's assigned character name, the user name, or"Unknown Speaker".Use toChat to post a message — it accepts either inline HTML or a template path and applies the speaker's roll mode automatically.