d1e5d57459
Generally speaking, I like to call the message at the bottom an "action message". And things can "trigger" it, but in the case of a method that actually proactively displays the message, I find "displayActionMessage" to be a better name. Also, removing package-lock files and improving code style
14 lines
410 B
JavaScript
14 lines
410 B
JavaScript
WA.onInit().then(() => {
|
|
let message;
|
|
|
|
WA.room.onEnterZone("carpet", () => {
|
|
message = WA.ui.displayActionMessage("This is a test message. Press space to display a chat message. Walk out to hide the message.", () => {
|
|
WA.chat.sendChatMessage("Hello world!", "The bot");
|
|
});
|
|
});
|
|
|
|
WA.room.onLeaveZone("carpet", () => {
|
|
message && message.remove();
|
|
});
|
|
});
|