b9bf27983f
Co-authored-by: David Négrier <d.negrier@thecodingmachine.com>
19 lines
457 B
JavaScript
19 lines
457 B
JavaScript
WA.onInit().then(() => {
|
|
let message;
|
|
|
|
WA.room.onEnterLayer("carpet").subscribe(() => {
|
|
message = WA.ui.displayActionMessage({
|
|
message:
|
|
"This is a test message. Press space to display a chat message. Walk out to hide the message.",
|
|
callback: () => {
|
|
WA.chat.sendChatMessage("Hello world!", "The bot");
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
WA.room.onLeaveLayer("carpet").subscribe(() => {
|
|
message && message.remove();
|
|
});
|
|
});
|