File ChatManager.lua
Functions
CM:GetRespondChannelByEvent (event) | Get the channel to be used as a response channel based on event name. |
CM:HandleMessage (msg, sender, channel, target, isBN) | Handle a chat message. |
CM:Init () | Initialize ChatManager. |
CM:IsCommand (msg) | Check if a string is a command. |
CM:LoadSavedVars () | Load saved variables. |
CM:ParseCommand (cmd) | Parse a command. |
CM:ParseMessage (msg) | Parse a message. |
CM:SendMessage (msg, channel, target) | Send a chat message. |
Tables
Command.ChatManager | Table holding all ChatManager methods. |
Functions
- CM:GetRespondChannelByEvent (event)
-
Get the channel to be used as a response channel based on event name.
Parameters:
-
event
: Full name of the event.
Return value:
- The channel to be used as response channel.
-
- CM:HandleMessage (msg, sender, channel, target, isBN)
-
Handle a chat message.
Parameters:
-
msg
: The message to handle. -
sender
: Player object of the player who sent the message. -
channel
: Channel the message was sent from. -
target
: Player or channel index. -
isBN
: True if battle.net message, false or nil otherwise.
-
- CM:Init ()
- Initialize ChatManager.
- CM:IsCommand (msg)
-
Check if a string is a command.
Parameters:
-
msg
: String to check.
Return value:
- True if the string is a command, false otherwise.
-
- CM:LoadSavedVars ()
- Load saved variables.
- CM:ParseCommand (cmd)
-
Parse a command.
Parameters:
-
cmd
: Command to parse.
Return value:
- Parsed command (without the command char)
-
- CM:ParseMessage (msg)
-
Parse a message.
Parameters:
-
msg
: The message to parse.
Return value:
- Table with the individual words.
-
- CM:SendMessage (msg, channel, target)
-
Send a chat message. Will echo the msg param locally if LOCAL_ONLY setting is true.
Parameters:
-
msg
: The message to send. -
channel
: The channel to send to. -
target
: Player or channel index to send message to.
-
Tables
- Command.ChatManager
- Table holding all ChatManager methods. This is referenced "CM" in ChatManager.lua.
Fields:
-
Settings
: Table holding all settings specific to ChatManager. -
Default
: Table containing default settings (used at initial setup) -
LastChannel
: Last channel argument passed to HandleMessage. -
LastTarget
: Last target argument passed to HandleMessage.
-