BNETDocs
C>S 0x0E SID_CHATCOMMAND
Message Id:0x0E
Message Name:SID_CHATCOMMAND
Direction:Client to Server
Used By:Diablo II, Diablo II Lord of Destruction
Diablo Retail, Diablo Shareware
Starcraft Japanese, Starcraft Broodwar
Starcraft Shareware, Starcraft Original
Warcraft II BNE, Warcraft III The Frozen Throne
Warcraft III Reign of Chaos
Format:

(STRING) Text *

Remarks

Send text or a command to Battle.net using this packet.

For STAR/SEXP/SSHR/JSTR, Text is UTF-8 encoded (WIDESTRING).

It is generally accepted as unwise to send any character below a space (0x20): this includes line feeds, carriage returns & control characters. The maximum number of characters is 224 per message including the null-terminator (so really only 223 characters), any longer and it becomes trimmed by Battle.net.

If you send a line feed and/or a carriage return, Battle.net disconnects you and IP bans you for 5 minutes.

Comments
Caaaaarrrrlll

It is possible to use %f# instead of usernames where # is the number from your friends list. This works with /w, /f, and basically any place you'd use a username. See the bottom of this page (archived copy) for more info.