ChatMessage

ChatMessage

The Chat Message class is a type of :class:Entity which represents individual messages in the chat log.

Constructor

new ChatMessage()

Source:

Members

(static) config

Source:

Configure the attributes of the ChatMessage Entity

_roll

Source:

If the Message contains a dice roll, store it here

alias :string

Source:

Return the recommended String alias for this message. The alias could be a Token name in the case of in-character messages or dice rolls. Alternatively it could be a User name in the case of OOC chat or whispers.

Type:
  • string

isAuthor :boolean

Source:

Is the current User the author of this message?

Type:
  • boolean

isContentVisible :boolean

Source:

Return whether the content of the message is visible to the current user

Type:
  • boolean

isRoll :boolean

Source:

Test whether the chat message contains a dice roll

Type:
  • boolean

permission

Source:

roll :Roll

Source:

Return the Roll instance contained in this chat message, if one is present

Type:

user

Source:

Get a reference to the user who sent the chat message

visible :boolean

Source:

Return whether the ChatMessage is visible to the current user Messages may not be visible if they are private whispers

Type:
  • boolean

Methods

(static) can()

Source:

(async, static) create()

Source:

(static) getSpeaker(sceneopt, actoropt, tokenopt, aliasopt) → {Object}

Source:

Attempt to determine who is the speaking character (and token) for a certain Chat Message First assume that the currently controlled Token is the speaker

Parameters:
Name Type Attributes Description
scene Scene <optional>

The Scene in which the speaker resides

actor Actor <optional>

The Actor whom is speaking

token Token <optional>

The Token whom is speaking

alias string <optional>

The name of the speaker to display

Returns:

The identified speaker data

Type
Object

(static) getSpeakerActor(speaker) → {Actor|null}

Source:

Obtain an Actor instance which represents the speaker of this message (if any)

Parameters:
Name Type Description
speaker Object

The speaker data object

Returns:
Type
Actor | null

(static) getWhisperRecipients(name) → {Array.<User>}

Source:

Given a string whisper target, return an Array of the user IDs which should be targeted for the whisper

Parameters:
Name Type Description
name string

The target name of the whisper target

Returns:

An array of User instances

Type
Array.<User>

_onDelete()

Source:

_onUpdate()

Source:

export() → {string}

Source:

Export the content of the chat message into a standardized log format

Returns:
Type
string

getRollData() → {Object}

Source:

Obtain a data object used to evaluate any dice rolls associated with this particular chat message

Returns:
Type
Object

(async) render() → {Promise.<HTMLElement>}

Source:

Render the HTML for the ChatMessage which should be added to the log

Returns:
Type
Promise.<HTMLElement>