This section describes common structures and Lua tables used to handle chat messaging jobs.
The Entity table contains information about a user. It is a Lua table with the following fields:
Field |
Type |
Description |
id |
Integer |
Contains the internal ID of the user. |
login |
String |
Contains the username of the user. If the value is equal to "@Firecast", the entity is the Firecast server itself. |
nick |
String |
(Optional) Contains the nickname of the user. If this field is missing, the value of the field login is assumed as nick. |
gender |
Enumerated/String:
|
(Optional) Defines the grammatical gender to be used when referring to the user.
If this field is missing, the grammatical gender "undefined" is assumed. |
The Impersonation table is a Lua table utilized to specify how a message is impersonated. It contains the following fields:
Field |
Type |
Description |
mode |
Enumerated/String:
|
Indicates the mode of impersonation:
If this field is missing, the mode "none" is assumed. |
avatar |
String |
(Optional) A URL string pointing to an image used as the avatar of the impersonation. This field is optional and applicable to "narrator" and "character" impersonation modes. |
gender |
Enumerated/String:
|
(Optional) Defines the grammatical gender to be used when referring to the impersonated entity.
If this field is missing, the grammatical gender "undefined" is assumed. |
name |
String |
(Optional) Defines the name and/or nickname of the character being impersonated. This field is optional and utilized with the "character" impersonation mode. |
The LogRec table describes a message in a chat. It is a Lua table with the following fields:
Field |
Type |
Description |
id |
String |
Identification of the message, generated by Firecast Client. The message is uniquely identified by combining the fields id and tid. |
tid |
String |
Identification of the message, generated by Firecast Server. The message is uniquely identified by combining the fields id and tid. The name tid stands for "timestamp id" because its value includes a server timestamp of when it was generated. Firecast uses tid to sort messages and perform sequential scans. |
timestamp |
|
When the message was sent in UTC. |
medium |
Identifies the chat in which the message was sent. |
|
entity |
This field identifies who sent the message. In the case of a kick, this field contains the user who was kicked, and "msg.responsible" identifies who performed the kick. |
|
msg |
The content of the message. |
|
visibility |
Describes the visibility of the message. |
|
updates |
Array of MsgUpdate table |
(Optional) An array containing the update history for this message, sorted in edition order. This message has not been updated if this field is missing or its length is zero. |
isDeleted |
Boolean |
(Optional) Indicates if the message was deleted from the chat. If missing or nil, the message was not deleted. |
deleter |
(Optional) Valid if isDeleted == true, identifies who deleted the message. |
|
deletionTimestamp |
(Optional) Valid if isDeleted == true, contains the timestamp in UTC of when the message was deleted. |
|
_visible |
Boolean |
An auxiliary flag, which is not part of the message itself. Indicates if this message can be visible to the user. |
_storable |
Boolean |
An auxiliary flag, which is not part of the message itself. Indicates if this message can be both visible to the user and can be stored in the Firecast server log. |
The Medium table identifies a communication medium in Firecast. It is a Lua table with the following fields:
Field |
Type |
Description |
kind |
Enumerated/String:
|
Defines the kind of the communication medium an can be one of the following values:
|
user1 user2 |
Integer |
(Optional) These two fields are valid when kind is "direct" or "pvtOnRoom" and contain the internal identification of the users involved in the chat. Remarks:
|
roomId |
Integer |
(Optional) Valid when kind is "room," "pvtOnRoom," "groupPvtOnRoom," or "roomChannel." Contains the internal identification of the room. |
groupId |
String |
(Optional) Valid when kind is "groupPvtOnRoom" and contains the unique identification of the private group chat inside a room. |
channelId |
String |
(Optional) Valid when kind is "roomChannel" and contains the unique identification of the channel inside a room (future implementation). |
The MsgContent table describes the content of a message. It is a Lua table with the following fields:
Field |
Type |
Description |
msgType |
String/Enumerated:
|
dentifies the type of message and can be one of the following values:
Remarks:
|
content |
String |
The string message content. |
roll |
|
(Optional) Valid when msgType == "dice". Describes the dice roll and its result. |
impersonation |
Defines how this message is impersonated. |
|
talemarkOptions |
The TalemarkOptions of this message, describing how Firecast should color, format, and parse the message. |
|
responsible |
(Optional) If present, this field identifies the responsible of the event, like who kicked a user, who invited a user to a PVT group chat, who changed a property in the chat, and so on. |
|
propertyId |
Any type |
(Optional) Valid for msgType "sys_mediumPropertyChange" and "sys_userPresencePropertyChange". Contains the identification of what property was changed. Some of the known values of this field are listed below:
|
oldValue |
Any type |
(Optional) Valid for msgType "sys_mediumPropertyChange" and "sys_userPresencePropertyChange". Contains the previous value of the property before its change. |
newValue |
Any type |
(Optional) Valid for msgType "sys_mediumPropertyChange" and "sys_userPresencePropertyChange". Contains the new value of the property after its change. |
fileName |
String |
(Optional) Valid when msgType == "file". Contains the name of the file. |
fileURL |
String |
(Optional) Valid when msgType == "file". Contains the URL address to download the file. |
fileMimeType |
String |
(Optional) Valid when msgType == "file". Contains the Mime Type of the file, like 'image/png', 'text/html', 'video/mp4', and so on. |
fileSize |
Integer |
(Optional) Valid when msgType == "file". Contains the file size in byte count. |
joinType |
String/Enumerated:
|
(Optional) Valid when msgType == "sys_userJoin". Defines how the user joined the chat medium and can be one of the following values:
|
leaveType |
String/Enumerated:
|
(Optional) Valid when msgType == "sys_userLeave". Defines how the user left the chat medium and can be one of the following values:
|
extra |
A custom Lua table |
(Optional) If defined, contains custom extra details of the message. Its content is not defined and can be anything. Used in msgType == "signal". |
The MsgUpdate table describes a single update made to the message. It is a Lua table with the following fields:
Field |
Type |
Description |
timestamp |
|
The timestamp in UTC of when this update was made to the message. |
updater |
This field identifies who changed the message. |
|
contentChanged |
Boolean |
(Optional) Indicates if the message content was changed in this update. Assumes false If this field is missing or nil. |
oldContent |
String |
(Optional) Valid when contentChanged == true, contains the message content string before the update. |
impersonationChanged |
Boolean |
(Optional) Indicates if the message impersonation was changed in this update. Assumes false If this field is missing or nil. |
oldImpersonation |
(Optional) Valid when impersonationChanged == true, contains the message impersonation before the update. |
|
talemarkOptionsChanged |
Boolean |
(Optional) Indicates if the message TalemarkOptions was changed in this update. Assumes false If this field is missing or nil. |
oldTalemarkOptions |
(Optional) Valid when talemarkOptionsChanged == true, contains the message TalemarkOptions before the update. |
The MsgVisibility table describes the visibility of a message. It is a Lua table with the following optional fields:
Field |
Type |
Description |
mode |
Enumerated/String:
|
Defines the message visibility mode:
If this field is missing, the mode "standard" is assumed. |
recipients |
Array of Integer |
(Optional) A Lua array containing the internal IDs of Firecast users that defines the message recipients. When mode == "standard", this field is ignored when sending messages, but Firecast Server uses it to describe who was in the chat at the moment the message was sent and could see it. When mode == "recipients", only those who are in this array can see the message. Internal IDs can be obtained using:
|
blacklist |
Array of Integer |
(Optional) A Lua array containing the internal IDs of Firecast users who can't see the message. It can be used when mode == "standard". Internal IDs can be obtained using:
|
The QueryLogRecsParams table is utilized to specify how to retrieve messages stored in the Firecast server. It is a Lua table with the following optional fields:
Field |
Type |
Description |
audit |
Boolean |
(Optional) Indicates whether the server should include deleted messages in the response. If this field is missing, it assumes a default value of "false". |
limit |
Integer |
(Optional) Specifies the number of messages to fetch. Valid values range from 1 to 50. If absent, the default value assumed is 50. |
timestamp |
(Optional) If defined, queries for the latest messages with a timestamp less than or equal to this value. Remarks:
|
|
tid |
String |
(Optional) If defined, queries for the latest messages with tid less than this tid. Remarks:
|
The QueryLogRecsResponse table contains the response of a query for messages stored in the Firecast server. It is a Lua table with the following fields:
Field |
Type |
Description |
bof |
Boolean |
This field indicates whether the query reached the beginning of the file. If true, no more messages exist with the same query parameters. If false, you can fetch more messages using the "tid" of the first message in the "logRecs" field. Remarks:
|
logRecs |
Array of LogRec table |
The messages fetched from the server, sorted by their tid (timestamp id). |
The SendMessageParameters table is employed to define additional parameters when sending messages to chats. It is a Lua table with the following optional fields:
Field |
Type |
Description |
impersonation |
(Optional) Describes how to impersonate the message. If missing, the message will not be impersonated. |
|
talemarkOptions |
(Optional) Describes how to color, format, and parse the message. If missing, the user's current talemark options will be used. |
|
visibility |
(Optional) Describes who will receive the message. If missing, the standard visibility will be used. |
The TalemarkBlockStyle table specifies the text style of a message block. It is a Lua table with the following optional fields
Field |
Type |
Description |
color |
String |
(Optional) A color string or a number with the pallete index defining the text font color. If missing, a default color will be assumed. |
bkgColor |
String |
(Optional) A color string or a number with the pallete index defining the text background color. If missing, a default background color will be assumed. |
bold |
Boolean |
(Optional) Should the text use bold style? Default: false |
italic |
Boolean |
(Optional) Should the text use italic style? Default: false |
strikeout |
Boolean |
(Optional) Should the text be struck out? Default: false |
underline |
Boolean |
(Optional) Should the text be underlined?? Default: false |
The TalemarkOptions table specifies how Firecast should color, format, and parse a message. It is a Lua table with the following optional fields:
Field |
Type |
Description |
defaultTextStyle |
(Optional) Describes the default text style. If missing, a default style will be assumed. |
|
charActionTextStyle |
(Optional) Describes the text block style for character actions. If missing, a default style will be assumed. |
|
charEmDashSpeechTextStyle |
(Optional) Describes the text block style for character speeches marked by "--". If missing, a default style will be assumed. |
|
charQuotedSpeechTextStyle |
(Optional) Describes the text block style for character speeches marked by quotes. If missing, a default style will be assumed. |
|
outOfCharTextStyle |
(Optional) Describes the text block style for out-of-character interlocutions. If missing, a default style will be assumed. |
|
parseCharActions |
Boolean |
(Optional) Should parse character actions marked with * * delimiters? Default: true |
parseCharEmDashSpeech |
Boolean |
(Optional) Should parse character speeches marked with -- delimiters? Default: true |
parseCharQuotedSpeech |
Boolean |
(Optional) Should parse character speeches marked by quotes? Default: true |
parseCommonMarkStrongEmphasis |
Boolean |
(Optional) Should parse strong/bold emphasis marked by ** ** and/or __ __ delimiters? Default: true |
parseHeadings |
Boolean |
(Optional) Should parse headings marked by #, ===, and/or ---- delimiters? |
parseHorzLines |
Boolean |
(Optional) Should parse horizontal lines marked by ----- and/or ****? |
parseInitialCaps |
Boolean |
(Optional) Should parse initial caps marked by {} delimiters? |
parseOutOfChar |
Boolean |
(Optional) Should parse out-of-character interlocution marked by (( )) delimiters? Default: true |
parseSmileys |
Boolean |
(Optional) Should parse smileys and memes? Default: true |
parseURL |
Boolean |
(Optional) Should parse URLs and links? Default: true |
trimTexts |
Boolean |
(Optional) Should excess spaces in the text be trimmed? Default: true |
The TalemarkTag table contains a single parsed tag of a talemark markup text. It is a Lua table that forms a tree structure with the following optional fields:
Field |
Type |
Description |
type |
String/Enumerated:
|
Present in all tags, contains the identification of what tag is this, and can be one of the following values:
|
children |
Array of TalemarkTag table |
(Optional) As TalemarkTag tables represent a tree structure, this field contains the children nodes and/or leaves of this tag. Remarks:
|
altText |
String |
(Optional) Valid when type == "smiley". If present, contains a Unicode string/emoji that can be used as an alternative way to present the smiley. |
aspect |
String/Enumerated:
|
(Optional) Valid when type == "image". Determines how the image should be presented, regarding its aspect ratio:
|
color |
String or Integer |
(Optional) Valid for types "fontColor" and "bkgColor":
|
descent |
Number |
(Optional) Valid when type == "image". If present, contains how much, in logical pixels, the image should descend the text baseline when presenting it. |
float |
String/Enumerated:
|
(Optional) Valid when type == "image". If present, indicates how the image should float in the text:
|
height |
Number |
(Optional) Valid when type == "image". If present, contains the height, in logical pixels, in which the image should be presented. |
id |
String |
(Optional) Valid when type == "smiley". Contains the identification of what smiley is this. |
isATX |
Boolean |
(Optional) Valid when type == "heading". Indicates if the heading was marked up in the text as an ATX-Style. False means the text was marked up as Setext-Style. ATX-Style example: ## My Heading Text Example Setext-Style example: My Heading Text Example ======= |
level |
Integer |
(Optional) Valid when type == "heading". Contains the depth level of the heading. Starts with the value 1. |
mode |
String/Enumerated:
|
(Optional) Valid for types "fontColor" and "bkgColor":
|
shortcut |
String |
(Optional) Valid when type == "smiley". Contains the text in the parsed text that generated this smiley. |
style |
String/Enumerated:
|
(Optional) Valid when type == "fontStyle". Contains which font style the span should be presented with. |
text |
String |
(Optional) Valid for types "text" and "url". The string text content of the tag. |
url |
String |
(Optional) Valid for types "url" and "image". The URL address of the link or image. |
width |
Number |
(Optional) Valid when type == "image". If present, it contains the width, in logical pixels, in which the image should be presented. |
The Timestamp table specifies a date and time. It is a Lua table with the following fields:
Field |
Type |
Description |
year |
Integer |
The year component |
month |
Integer |
The month component, with values in the range from 1 to 12. |
day |
Integer |
The day component, with values in the range from 1 to 31. |
hour |
Integer |
(Optional) The hour component, with values in the range from 0 to 23. |
min |
Integer |
(Optional) The minute component, with values in the range from 0 to 59. |
sec |
Integer |
(Optional) The seconds component, with values in the range from 0 to 59. |
msec |
Integer |
(Optional) The milliseconds component, with values in the range from 0 to 999. |
Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help Authoring Tool