Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
m (Added AFK/DND)
(added nil using default langu)
Line 13: Line 13:
 
:;system (Optional) : the type of chat message to be sent eg. "SAY", "WHISPER", "EMOTE", "CHANNEL", "PARTY", "GUILD", "YELL", "RAID", "AFK", "DND"
 
:;system (Optional) : the type of chat message to be sent eg. "SAY", "WHISPER", "EMOTE", "CHANNEL", "PARTY", "GUILD", "YELL", "RAID", "AFK", "DND"
 
:;language (Optional) : language used to translate 'msg' eg. "COMMON".
 
:;language (Optional) : language used to translate 'msg' eg. "COMMON".
::'''Languages''': Common, Darnassian, Dwarvish, Taurahe, Orcish, Gutterspeak, Demonic ...
+
::'''Languages''': Common, Darnassian, Dwarvish, Taurahe, Orcish, Gutterspeak, Demonic ... (using nil for language will use default lanuage)
 
:;channel (Optional) : the channel or player recieving the message. It might be obvious to some, but I had to pass a number when sending to a channel. You can obtain it using [[API_GetChannelName|GetChannelName]].
 
:;channel (Optional) : the channel or player recieving the message. It might be obvious to some, but I had to pass a number when sending to a channel. You can obtain it using [[API_GetChannelName|GetChannelName]].
   

Revision as of 16:35, 16 April 2006

SendChatMessage -Documentation by AlexanderYoshi-

Sends a chat message.

SendChatMessage(msg, system, language, channel);

Arguments
(String msg, String system, String language, String channel)
msg
message to be sent, maximum 255 characters long
system (Optional)
the type of chat message to be sent eg. "SAY", "WHISPER", "EMOTE", "CHANNEL", "PARTY", "GUILD", "YELL", "RAID", "AFK", "DND"
language (Optional)
language used to translate 'msg' eg. "COMMON".
Languages: Common, Darnassian, Dwarvish, Taurahe, Orcish, Gutterspeak, Demonic ... (using nil for language will use default lanuage)
channel (Optional)
the channel or player recieving the message. It might be obvious to some, but I had to pass a number when sending to a channel. You can obtain it using GetChannelName.

Returns
nil

Example
SendChatMessage("Hello Kelthan!", "WHISPER", "Common", "Kelthan");
Result
<To Kelthan > Hello Kelthan!
Example
local s = "message string"
local type = "CHANNEL"
local lang = this.language
local index = GetChannelName("Cosmos")--it finds cosmos is a channel at index 5
if(index~=nil) then SendChatMessage( s , "CHANNEL", lang, index); end
Result

[5.Cosmos][Mesoonic]message string



Description
Sends a chat message of the specifiedtext message, according to the system of "SAY", "YELL", "EMOTE", "PARTY", "AFK", "DND", "GUILD", "OFFICER", in the language, such as "COMMON" or "DRACONIC" or "ORCISH" etc, with your target channel.
"AFK" and "DND" set your AFK or DND auto-reply. To cancel afk/dnd status, send another message to the same "channel".
If not input, the System defaults to "SAY", the language to whatever language you are set to speak at the time, and the "General" channel. It should be noted that you must provide both a language and a channel when performing a "WHISPER".
To send a whisper to the player's selected target, use UnitName("target") as the Channel.
It could be a bug, but when you run this API command you can send Whispers using any language (including those from other factions). The end listener hears it in their own language, and thus understands it, however on your screen the message is in untranslated Orcish, Dwarvish or whatever you like.
This also works in other chat modes. Guild, party, and whisper. Not in say. (Astinus 21:06, 31 Jan 2005 (EST))
It does work in "SAY". In certain channels such as GUILD and PARTY you are able to fully speak in any language, but in channels such as SAY and YELL it only shows up translated to you, and everyone else sees either Orcish or Common depending on your race. --Bug 19:12, 4 Feb 2005 (EST)
Error: Unknown language when trying to speak another factions tongue. ~~ mds 11:41, 15 May 2005 (UTC+1)
In the german Version you have to use the german names of the languages, eg. "Gemeinsprache"
Some channels may have restrictions on who may speak in them. For example, in order to speak in the World Defense channel, you must have a PvP rank of 11 or higher. --The Nerd Wonder 10:10, 12 Jan 2006 (EST)

Template:WoW API