MessageNode

Group
player
Methods
12
Fields
None

Getting one

client:addChatMessage(…)
client:getMessages():get(…)

Methods

MethodReturnsDescription
getId()numberThe message's id: what client:getMessages():get(id) finds it by, and what the chat-build script callbacks pass as its uid.
getType()ChatMessageTypeThe message's type: CLAN_GIM_CHAT / CLAN_GIM_MESSAGE for a line of your group-ironman channel (the game stores those as clan lines whos…
getName()stringThe name of the player that sent it, as received: icon tags (<img=N>) and no-break spaces included; "" for a game message.
setName(string?)()Set the name the chatbox shows; the line's right-click options act on the new name too (the game's username is rebuilt from it).
getSender()string?The friends-chat or clan channel it came through, or nil outside one.
setSender(string?)()Set the channel the chatbox shows; nil clears it.
getValue()stringThe message's text, tags included (a group-ironman line's without the | the game stores before it).
setValue(string?)()Set the message's text (the chatbox's display text is rebuilt from it); a group-ironman line keeps its |.
getClientFormatMessage()string?The client format that replaces the text when the chatbox builds the line (<colNORMAL>, <colHIGHLIGHT> resolved for the chat type and t…
setClientFormatMessage(string?)()Set the client format the chatbox shows in place of the text; nil shows the text again.
getTimestamp()numberWhen it was added, in seconds since the Unix epoch. A message added before Bento attached answers the game's own minute stamp.
setTimestamp(number)()Set its timestamp (seconds since the Unix epoch).

Returned by

MethodReturnsDescription
ChatLineBuffer.getLines{MessageNode}The lines, newest first. A buffer has 100 slots; this array holds only the getLength() lines in use, and lines[k] past them is nil (`…
ChatMessage.getMessageNodeMessageNode?The message in the chatbox: edit it with setValue, setName, setClientFormatMessage. nil for a message the differ reported.
ChatMessageTable.getMessageNode?The message with id id, or nil: what the chat-build script callbacks' uid names.
Client.addChatMessageMessageNode(Client, ChatMessageType, string, string, string?) -> MessageNode: Add a line to the chatbox through the client's own message add (a `Cha…

Method details

getId

getId: (MessageNode) -> number

The message's id: what client:getMessages():get(id) finds it by, and what the chat-build script callbacks pass as its uid.

getType

getType: (MessageNode) -> ChatMessageType

The message's type: CLAN_GIM_CHAT / CLAN_GIM_MESSAGE for a line of your group-ironman channel (the game stores those as clan lines whose text starts with |).

getName

getName: (MessageNode) -> string

The name of the player that sent it, as received: icon tags (<img=N>) and no-break spaces included; "" for a game message.

setName

setName: (MessageNode, string?) -> ()

Set the name the chatbox shows; the line's right-click options act on the new name too (the game's username is rebuilt from it).

getSender

getSender: (MessageNode) -> string?

The friends-chat or clan channel it came through, or nil outside one.

getValue

getValue: (MessageNode) -> string

The message's text, tags included (a group-ironman line's without the | the game stores before it).

setValue

setValue: (MessageNode, string?) -> ()

Set the message's text (the chatbox's display text is rebuilt from it); a group-ironman line keeps its |.

getClientFormatMessage

getClientFormatMessage: (MessageNode) -> string?

The client format that replaces the text when the chatbox builds the line (<colNORMAL>, <colHIGHLIGHT> resolved for the chat type and the chatbox's transparency), or nil. Messages queued with clientFormattedMessage carry one.

getTimestamp

getTimestamp: (MessageNode) -> number

When it was added, in seconds since the Unix epoch. A message added before Bento attached answers the game's own minute stamp.