WoW:API SendAddonMessage: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (→‎Notes: CHAT_MSG_ADDON is invoked on all clients.)
(revise)
Line 1: Line 1:
{{wowapi}}
{{wowapi}} __NOTOC__
Sends a message to hidden AddOn channels. ('''new with patch 1.12''')
Sends a message to hidden AddOn channels. Introduced in [[Patch 1.12]].
SendAddonMessage("prefix", "text", "type")


SendAddonMessage("prefix", "text", "PARTY|RAID|GUILD|BATTLEGROUND")
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
 
:;prefix : String - Message prefix, can be used as your addon identifier.
:;prefix : String - Message Prefix ( Used to figure out which addon sent the message )
:;text : String - Text to send.
:;text : String - Text to send
:;type : String - AddOn channel to send to. Valid types are "PARTY", "RAID", "GUILD", "BATTLEGROUND".
:;type : String - AddOn channel to send to, valid types are "PARTY", "RAID", "GUILD", "BATTLEGROUND"


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


== Notes ==
== Notes ==
From [[Slouken]]:
* 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.
* The combined length of message plus prefix can be at most 254 characters.
* 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.
* The message will be unaffected by inebriation.
* The message will not be affected by the player's level of [[Drunk|drunkenness]].
* Messages sent to "RAID" when not in a raid will be delivered as if it had been sent as a "PARTY" message.
* 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).
* Using "RAID" or "PARTY" when not in a party or raid sends no message.  
* Like [[API_SendChatMessage|SendChatMessage]], sending a message containing "\n" will disconnect you.
 
 
* Calling this function results in the event [[Events/C#CHAT_MSG_ADDON|CHAT_MSG_ADDON]] being invoked on ''all'' client machines in the PARTY, RAID, BATTLEGROUND or GUILD.
* The prefix cannot include a tab character ("\t") as it's used as a delimiter between the prefix and the text when the message is sent from the client. When the message is recieved by other clients, it's broken back in to two peices in the client and the sent to lua.  Using a tab character in the text may be acceptable, but is unadvised.
* If you want to send messages inbetween your battleground group you will need to use "BATTLEGROUND" instead of "RAID" or "PARTY".
* "Send'''Addon'''Message" isn't a typo, using "Send'''AddOn'''Message" will not work.
 
* it seems that ASCII 10 codes (thats the linefeed, or \n character) in the text get you disconnected (note from [[User:Psycoparrot|psycoparrot]])
 
__NOTOC__
{{AlsoSee|[[API SendChatMessage]]}}

Revision as of 17:04, 8 January 2007

WoW API < SendAddonMessage

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

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

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".

Example

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

Notes

  • Calling this function results in the event CHAT_MSG_ADDON being invoked on all clients in the PARTY, RAID, BATTLEGROUND or GUILD channels.
  • 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.
  • 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).
  • Like SendChatMessage, sending a message containing "\n" will disconnect you.