Difference between revisions of "Bot Playground/Events/teleport offer"
From SmartBots Developers Docs
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:teleport_offer}} | {{DISPLAYTITLE:teleport_offer}} | ||
<onlyinclude>Fires when bot receives a teleport offer from another avatar.</onlyinclude> | <onlyinclude>Fires when bot receives a teleport offer from another avatar.</onlyinclude> | ||
+ | |||
+ | <syntaxhighlight lang="javascript"> | ||
+ | Bot.on("teleport_offer", function(event) { ... }); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Use [[Bot Playground/Commands/acceptTeleportOffer|acceptTeleportOffer]] to "accept/reject" a teleport offer. | ||
{{API Event Table}} | {{API Event Table}} | ||
− | {{API Variable Group| | + | {{API Variable Group|''event'' object properties}} |
+ | {{API Variable|avatar_name}}Sender's SL name | ||
{{API Variable|avatar_uuid}}The UUID of the sender | {{API Variable|avatar_uuid}}The UUID of the sender | ||
+ | {{API Variable|message}}Teleport offer message | ||
+ | {{API Variable|slurl}}The teleport location | ||
{{API Variables Table End}} | {{API Variables Table End}} | ||
Line 12: | Line 21: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Bot.on("teleport_offer", function(event) { | Bot.on("teleport_offer", function(event) { | ||
− | + | console.log("Got teleport offer from: " + event.avatar_name); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
}); | }); | ||
Latest revision as of 08:20, 18 October 2022
Fires when bot receives a teleport offer from another avatar.
Bot.on("teleport_offer", function(event) { ... });
Use acceptTeleportOffer to "accept/reject" a teleport offer.
Reference
This event comes with the following event object:
Variable | Required | Description | |
---|---|---|---|
event object properties: | |||
avatar_name | Sender's SL name | ||
avatar_uuid | The UUID of the sender | ||
message | Teleport offer message | ||
slurl | The teleport location |
Example
Bot.on("teleport_offer", function(event) {
console.log("Got teleport offer from: " + event.avatar_name);
});
console.log("Bot is listening, teleport offers");