@vttforge/core / ChatMessageLike
Interface: ChatMessageLike<System> ​
A chat message.
Extends ​
DocumentMembers<System>
Type Parameters ​
System ​
System = Record<string, unknown>
Properties ​
alias ​
readonlyalias:string
The speaker's display name.
author ​
readonlyauthor:UserLike|null
blind ​
readonlyblind:boolean
content ​
readonlycontent:string
documentName ​
readonlydocumentName:string
'Actor', 'Item', 'ActiveEffect', and so on.
Inherited from ​
emote ​
readonlyemote:boolean
flags ​
readonlyflags:DocumentFlags
Inherited from ​
flavor ​
readonlyflavor:string
id ​
readonlyid:string|null
Inherited from ​
img ​
readonlyimg:string|null
Inherited from ​
isAuthor ​
readonlyisAuthor:boolean
isContentVisible ​
readonlyisContentVisible:boolean
isOwner ​
readonlyisOwner:boolean
Whether the current user owns this document.
Inherited from ​
isRoll ​
readonlyisRoll:boolean
name ​
readonlyname:string
Inherited from ​
parent ​
readonlyparent:DocumentMembers<Record<string,unknown>> |null
The document this one is embedded in, or null at the top level.
Inherited from ​
rolls ​
readonlyrolls:RollLike[]
sound ​
readonlysound:string|null
speaker ​
readonlyspeaker:ChatSpeakerData
speakerActor ​
readonlyspeakerActor:ActorLike<Record<string,unknown>,ItemLike<Record<string,unknown>>> |null
style ​
readonlystyle:number
system ​
readonlysystem:System
The type data model instance. Its fields are the schema's fields.
Inherited from ​
timestamp ​
readonlytimestamp:number
title ​
readonlytitle:string
type ​
readonlytype:string
The subtype, as declared under documentTypes in the manifest.
Inherited from ​
uuid ​
readonlyuuid:string
Inherited from ​
visible ​
readonlyvisible:boolean
whisper ​
readonlywhisper:string[]
Methods ​
applyMode() ​
applyMode(
mode):void
Apply a CONFIG.ChatMessage.modes key to this message.
Parameters ​
mode ​
string
Returns ​
void
delete() ​
delete(
operation?):Promise<ChatMessageLike<System> |undefined>
Parameters ​
operation? ​
Record<string, unknown>
Returns ​
Promise<ChatMessageLike<System> | undefined>
Inherited from ​
export() ​
export():
string
Returns ​
string
getFlag() ​
getFlag<
T>(scope,key):T|undefined
Type Parameters ​
T ​
T = unknown
Parameters ​
scope ​
string
key ​
string
Returns ​
T | undefined
Inherited from ​
getRollData() ​
getRollData():
Record<string,unknown>
Returns ​
Record<string, unknown>
renderHTML() ​
renderHTML(
options?):Promise<HTMLElement>
Parameters ​
options? ​
canClose? ​
boolean
canDelete? ​
boolean
Returns ​
Promise<HTMLElement>
setFlag() ​
setFlag(
scope,key,value):Promise<ChatMessageLike<System>>
Parameters ​
scope ​
string
key ​
string
value ​
unknown
Returns ​
Promise<ChatMessageLike<System>>
Inherited from ​
testUserPermission() ​
testUserPermission(
user,permission,options?):boolean
Whether a user has at least this level of access to the document.
isOwner answers the same question for the current user and the highest level. This answers it for any user and any level, which is what a package asks before it shows someone another person's document.
if (item.testUserPermission(game.user, 'LIMITED')) render(link);Parameters ​
user ​
unknown
permission ​
number | "NONE" | "LIMITED" | "OBSERVER" | "OWNER"
options? ​
exact? ​
boolean
Returns ​
boolean
Inherited from ​
DocumentMembers.testUserPermission
toObject() ​
toObject(
source?):Record<string,unknown>
A plain-object copy. source reads the stored data instead of the prepared data.
Parameters ​
source? ​
boolean
Returns ​
Record<string, unknown>
Inherited from ​
unsetFlag() ​
unsetFlag(
scope,key):Promise<ChatMessageLike<System>>
Parameters ​
scope ​
string
key ​
string
Returns ​
Promise<ChatMessageLike<System>>
Inherited from ​
update() ​
update(
data,operation?):Promise<ChatMessageLike<System> |undefined>
Parameters ​
data ​
Record<string, unknown>
operation? ​
Record<string, unknown>
Returns ​
Promise<ChatMessageLike<System> | undefined>