SendChatMessage

From Wowpedia
Jump to: navigation, search

Sends a chat message.

SendChatMessage(msg [, chatType, languageID, target])

Arguments

msg 
string - The message to be sent. Large messages are truncated to max 255 characters, and only valid chat message characters are permitted.
chatType 
string? - The type of message to be sent, e.g. "PARTY". If omitted, this defaults to "SAY"
languageID 
number? - The languageID used for the message. If omitted the default language will be used: Orcish for the Horde and Common for the Alliance, as returned by GetDefaultLanguage()
target 
string|number? - The player name or channel number receiving the message for "WHISPER" or "CHANNEL" chatTypes.

Chat types

HW - denotes if the chatType requires a hardware event when in the outdoor world, i.e. not in an instance/battleground.
chatType Command HW Description
"SAY" /s, /say
✔️
Speech to nearby players
"EMOTE" /e, /emote Custom text emote to nearby players (See DoEmote for voice emotes)
"YELL" /y, /yell
✔️
Yell to not so nearby players
"PARTY" /p, /party Chat message to party members
"RAID" /ra, /raid Chat message to raid members
"RAID_WARNING" /rw Audible warning message to raid members
"INSTANCE_CHAT" /i, /instance Chat message to the instance group (Dungeon finder / Battlegrounds / Arena)
"GUILD" /g, /guild Chat message to guild members
"OFFICER" /o, /officer Chat message to guild officers
"WHISPER" /w, /whisper
/t, /tell
Whisper to a specific other player, use player name as target argument
"CHANNEL" /1, /2, ...
✔️
Chat message to a specific global/custom chat channel, use channel number as target argument
"AFK" /afk Not a real channel; Sets your AFK message. Send an empty message to clear AFK status.
"DND" /dnd Not a real channel; Sets your DND message. Send an empty message to clear DND status.

Details

Examples

Sends a message, defaults to "SAY".

SendChatMessage("Hello world")

Sends a /yell message.

SendChatMessage("For the Horde!", "YELL")

Sends a message to General Chat which is usually channel number 1

SendChatMessage("Hello friends", "CHANNEL", nil, 1)

Whispers your target.

SendChatMessage("My, you're a tall one!", "WHISPER", nil, UnitName("target"))

Sets your /dnd message.

SendChatMessage("I'm punting a gnome", "DND")

Patch changes

See also

External links

References

  1. ^ Deadly Boss Mods 2019-09-25. SendChatMessage restrictions.