Wizards of Lua

The Art of Spell Crafting


ChatEvent - Knowing what Players are Talking About

The ChatEvent class contains information about a chat message that has been posted by some player.

Example

Echoing all chat messages.

local queue=Events.collect("ChatEvent")
while true do
  local event=queue:next()
  spell:execute("say %s", event.message)
end

The ChatEvent class is a subtype of the Event class and inherits all its properties and functions.

Here is an overview of the ChatEvent properties:

Property Type read / write
message string r
player Player r

Properties

Below you find short descriptions about each of the properties and some examples about how to use them in your spells.


message : string

The chat message that has been posted.


player : Player

The player that sent the chat message.