WoW:API SendAddonMessage: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Updated with new information -> allowed characters)
Line 14: Line 14:


== Notes ==
== Notes ==
* Calling this function results in the event [[Events/C#CHAT_MSG_ADDON|CHAT_MSG_ADDON]] being invoked on all clients in the PARTY, RAID, BATTLEGROUND or GUILD channels.
* Calling this function results in the event [[Events/C#CHAT_MSG_ADDON|CHAT_MSG_ADDON]] being invoked on:
* Messages sent to "RAID" while in a party will get delivered to "PARTY"; messages sent to "RAID" or "PARTY" while not in a group will not be delivered. To send to your battleground group, "BATTLEGROUND" must be used.
** <target>'s client if <type> is "WHISPER" or
** all clients in the <type> chat channel, otherwise
* Messages sent to "RAID" while in a party will get delivered to "PARTY"
* To send to your battleground group, "BATTLEGROUND" must be used
* Messages sent to <type> when you are not in the specified community will not be delivered.
* The message will not be affected by the player's level of [[Drunk|drunkenness]].
* The message will not be affected by the player's level of [[Drunk|drunkenness]].
* The tab character ("\t") is used as a delimiter between the prefix and the message text -- because of this, \t can not be used as part of prefix. The combined length of message and prefix can be at most 254 characters (255th is the tab character used to delimit the two), length above 254 will disconnect you.
* The tab character ("\t") is used as a delimiter between the prefix and the message text
** because of this, \t can not be used as part of prefix
** The combined length of message and prefix can be at most 254 characters (255th is the tab character used to delimit the two)
** length above 254 will disconnect you.
* except NULL (ASCII dec-ID 0) all characters (decimal ID 1-255) are allowed (in opposition to [[API SendChatMessage|SendChatMessage]] where many characters are disallowed)
* except NULL (ASCII dec-ID 0) all characters (decimal ID 1-255) are allowed (in opposition to [[API SendChatMessage|SendChatMessage]] where many characters are disallowed)
* The "WHISPER" mode was added with patch 2.1, as servers will begin to rate throttle regular whispers to alleviate [[spam]] problems.
* The "WHISPER" mode was added with patch 2.1, as servers will begin to rate throttle regular whispers to alleviate [[spam]] problems.
* As of 2.1.0 whispers sent cross-server in battlefields will be sent as regular whispers and aren't hidden by the addon channel.
* As of 2.1.0 whispers sent cross-server in battlefields will be sent as regular whispers and aren't hidden by the addon channel.

Revision as of 16:56, 1 July 2008

WoW API < SendAddonMessage

Sends a message to hidden AddOn channels. Introduced in Patch 1.12.

SendAddonMessage("prefix", "text", "type", "target")

Parameters

Arguments

prefix
String - Message prefix, can be used as your addon identifier.
text
String - Text to send.
type
String - AddOn channel to send to. Valid types are "PARTY", "RAID", "GUILD", "BATTLEGROUND". As of 2.1, "WHISPER" was also added.
target
String - Used only for "WHISPER" communication - the player to whisper to.

Example

SendAddonMessage( "CTRA", "User Data: XYZ", "RAID" );

Notes

  • Calling this function results in the event CHAT_MSG_ADDON being invoked on:
    • <target>'s client if <type> is "WHISPER" or
    • all clients in the <type> chat channel, otherwise
  • Messages sent to "RAID" while in a party will get delivered to "PARTY"
  • To send to your battleground group, "BATTLEGROUND" must be used
  • Messages sent to <type> when you are not in the specified community will not be delivered.
  • The message will not be affected by the player's level of drunkenness.
  • The tab character ("\t") is used as a delimiter between the prefix and the message text
    • because of this, \t can not be used as part of prefix
    • The combined length of message and prefix can be at most 254 characters (255th is the tab character used to delimit the two)
    • length above 254 will disconnect you.
  • except NULL (ASCII dec-ID 0) all characters (decimal ID 1-255) are allowed (in opposition to SendChatMessage where many characters are disallowed)
  • The "WHISPER" mode was added with patch 2.1, as servers will begin to rate throttle regular whispers to alleviate spam problems.
  • As of 2.1.0 whispers sent cross-server in battlefields will be sent as regular whispers and aren't hidden by the addon channel.