errors and warnings / stdlib / E8001
E8001 error
send used with a WoW event (only messages can be sent)
- area
- stdlib (x8xxx)
- fails the build
- yes
send from wowlua:events dispatches a message to your own addon's handlers.
WoW events such as PLAYER_LOGIN come from the game client and can't be sent
by an addon, so passing one to send is an error.
Declare your own message with declare message and send that instead;
handlers subscribe to it with on like to any event.
Example
import send from "wowlua:events"send("PLAYER_LOGIN")import on, send from "wowlua:events" declare message MYADDON_READY() on("MYADDON_READY", function() print("ready") end)send("MYADDON_READY")The compiler reports it like this:
error[E8001]: `PLAYER_LOGIN` is a WoW event; only messages can be sent ┌─ src/main.wowlua:2:6 │ 2 │ send("PLAYER_LOGIN") │ ^^^^^^^^^^^^^^ a WoW event
Related codes
| code | message |
|---|---|
| E8003 | Unknown event or message name |
Offline
$ wowlua explain E8001 E8001 (error): send used with a WoW event (only messages can be sent)