Difference between revisions of "Bot Playground/Events/teleport offer"

From SmartBots Developers Docs
Jump to: navigation, search
Line 8: Line 8:
 
{{API Event Table}}
 
{{API Event Table}}
 
{{API Variable Group|''event'' object properties}}
 
{{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}}

Revision as of 18:54, 10 September 2022

Fires when bot receives a teleport offer from another avatar.

Bot.on("teleport_offer", function(event) { ... });

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) {
  Bot.key2name(event.avatar_uuid)
  .then(function(result) {
    if(result.success) {
      console.log("Got teleport offer from: " + result.slname);
    } else {
      console.log("Error executing key2name: " + result.error);
    }
  });
});

console.log("Bot is listening, teleport offers");