API/Comm
Parameters in red are optional.
plugin:RegisterListener(module, listener)
Register a message to listen for.
Parameters
- module (table) The module that want to listen to the message.
- listener (string) A function with this name must exist on the module object, or the module must have an OnSync function that takes looks like func(listener, sender, dist, ...).
plugin:Send(comMsg, dist, target, ...)
Send a message over the addon communication channel
Parameters
- comMsg (string) The string that ideintifies the message.
- dist (string) The distrubution to use (GUILD, RAID, WHISPER etc.)
- target (string) The target to send the message to, only used when the dist is WHISPER.
- ... (data) Any kind of data to send along with the message.
plugin:UnregisterAllListeners(module)
Unregister all listening messages for a module.
Parameters
- module (table) The module that wants all messages unregistered.
plugin:UnregisterListener(module, listener)
Unregister a listening message for a module.
Parameters
- module (table) The module that wants to unregister for a message.
- listener (string) The message to stop listening for.
Comments