Gaming
 

Telepathy.registerListener

From WoWWiki

This article is a part of the documentation of the Telepathy function library

Usage

Telepathy.registerListener ( id, method, callback, partialCallback )
  • Registers a listener which will call a callback function when a message is recieved.

Arguments

  • id - text id passed to identify sending and recieving addon
  • method - table or string of events to listen for ("GLOBAL", "PARTY", "RAID", "GUILD", "BATTLEGROUND" or "WHISPER")
    • ex: "GLOBAL"
    • ex: { "GLOBAL", "WHISPER" }
  • callback - function(message, sender, method)
    • [called when a complete message is recieved]
      • message - message recieved
      • sender - person who sent the message
      • method - "GLOBAL", "PARTY", "RAID", "GUILD", "BATTLEGROUND" or "WHISPER"
  • partialCallback - "function(sender, method, sequenceNumber, sequenceCount, numberRecieved)
    • [called when a partial message is recieved; not called for the final piece]
      • sender - person who sent the datagram (partial message)
      • method - "GLOBAL", "PARTY", "RAID", "GUILD", "BATTLEGROUND" or "WHISPER"
      • sequenceNumber - currently recieved datagram sequence number
      • sequenceCount - total datagrams expected
      • numberRecieved - total number of recieved datagrams (out of sequenceCount)

Return Values

  • successful - boolean that message passed required checks