errors and warnings / stdlib / E8010
E8010 error
Duplicate slash command
- area
- stdlib (x8xxx)
- fails the build
- yes
The same slash command is registered twice in the addon, with @slash or the
slash module. Commands are compared without case, so /mytool and /MyTool
are the same command; the game would run only one of the handlers.
Register each command once. To give one handler several commands, list them
all in one @slash(...).
Example
import slash from "wowlua:slash" @slash("/mytool")local function open(msg: string) print(msg) end @slash("/MyTool")local function toggle(msg: string) print(msg) endimport slash from "wowlua:slash" @slash("/mytool", "/mt")local function open(msg: string) print(msg) endThe compiler reports it like this:
error[E8010]: the slash command `/MyTool` is registered twice ┌─ src/main.wowlua:6:8 │ 6 │ @slash("/MyTool") │ ^^^^^^^^^ again
Related codes
| code | message |
|---|---|
| E8101 | Invalid slash command name (must start with /, no whitespace) |
| W8011 | Slash command collides with a Blizzard command |
Offline
$ wowlua explain E8010 E8010 (error): Duplicate slash command