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:

isAuthor :boolean

Source:

Is the current User the author of this message?

Type:
  • boolean

isRoll :boolean

Source:

Test whether the chat message contains a dice roll

Type:
  • boolean

isRollVisible :boolean

Source:

Return whether the message contains a visible dice roll

Type:
  • boolean

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:

(async, static) createMany()

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

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 IDs (or possibly none)

Type
Array

export() → {String}

Source:

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

Returns:
Type
String

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

Source:

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

Returns:
Type
Promise.<HTMLElement>