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

(async, static) create()

Source:

(static) getSpeaker() → {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

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) getWhisperIDs(name) → {Array.<string>}

Source:
Deprecated:
  • since 0.5.2 and will be removed in 0.6.2

Backwards compatibility, now deprecated. Move to getWhisperRecipients

Parameters:
Name Type Description
name string

The target name of the whisper

Returns:

An Array of string User IDs

Type
Array.<string>

(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>

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>