Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:Creating a slash command
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Notes == * Default UI commands often have precedence over addon-created slash commands. There is no defined precedence order for addon-created commands, so conflicts caused by multiple addons attempting to use the same slash command will resolve non-deterministically. ** If the unique command identifier (the key in SlashCmdList) conflicts between multiple addons, the addon that executes the assignment last will own the slash command. * Command identifiers are generally all caps, with underscores if necessary. These can also contain lowercase characters. ** The actual 'SLASH_<CommandId><Number>' values should be localizable if you plan on your addon being translated, but the command ID will remain the same. * Be prudent about how many aliases you make for your command, and try and pick something that's unlikely to collide with someone else's (including Blizzard's!) * There's a second parameter passed to the slash command handler functions that is rarely used. It is the chat frame edit box frame that the slash command originated from. SLASH_BLAH1 = "/blah" SlashCmdList["BLAH"] = function(msg, editBox) -- change the text on the editBox. editBox:Show() editBox:SetText("Blah blah blah!") end * If you want to set your slash command handler function to a method of an object, you will need to encapsulate the call to it inside a dummy function. function SomeObject:SlashHandler(message, editbox) -- do stuff end SLASH_BLAH1 = "/blah" SlashCmdList["BLAH"] = function(message, editbox) SomeObject:SlashHandler(message, editbox) end [[Category:AddOns]] [[Category:HOWTOs]]
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)