2021-08-03 22:37:49 +02:00
|
|
|
WA.onInit().then(() => {
|
2021-11-03 16:51:33 +01:00
|
|
|
let message;
|
2021-08-03 22:37:49 +02:00
|
|
|
|
2021-11-03 16:51:33 +01:00
|
|
|
WA.room.onEnterLayer("carpet").subscribe(() => {
|
|
|
|
message = WA.ui.displayActionMessage({
|
|
|
|
message:
|
2021-11-08 10:51:08 +01:00
|
|
|
"This is a test message. Press space to display a chat message. Walk out to hide the message.",
|
2021-11-03 16:51:33 +01:00
|
|
|
callback: () => {
|
|
|
|
WA.chat.sendChatMessage("Hello world!", "The bot");
|
|
|
|
},
|
2021-08-03 22:37:49 +02:00
|
|
|
});
|
2021-11-03 16:51:33 +01:00
|
|
|
});
|
2021-08-03 22:37:49 +02:00
|
|
|
|
2021-11-03 16:51:33 +01:00
|
|
|
|
|
|
|
WA.room.onLeaveLayer("carpet").subscribe(() => {
|
|
|
|
message && message.remove();
|
|
|
|
});
|
2021-08-03 22:37:49 +02:00
|
|
|
});
|