Sends a message, and adds it to the message history.
The message to send.
Rest
...args: TranslationArg[]Arguments to interpolate the message with.
Note: After sending a message, the message source, type, and human (if any) are reset.
Rest
...extraSources: Source[]Sets the sources of the next message. Removes any existing sources.
Includes Source.All
by default, and NOT Source.Game
Rest
...sources: (undefined | false | Source)[]Sets the sources of the next message. Removes any existing sources.
Includes Source.All
and Source.Game
by default
Rest
...sources: (undefined | false | Source)[]Sets the type of the next message.
Optional
upgrader: ITranslationUpgraderStatic
toRuns a callback with the message manager of every player. For sending messages, equivalent to the following:
players.map(player => callback(player.messages)).some(sent => sent)
Example usage:
MessageManager.toAll(message => message.source(Source.Wellbeing)
.type(MessageType.Bad)
.send(Message.EveryoneHasBecomeInfected, reason));
Note: When this is called from a client, it actually only displays the message to the client and syncs that with the server. When called from the server, it is sent to every client.
Generated using TypeDoc
Clears the entire message history.