Difference between revisions of "Bot Playground/Commands/acceptInventoryOffer"

From SmartBots Developers Docs
Jump to: navigation, search
Line 15: Line 15:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
See [[/Bot_Playground/Events/inventory_offer| inventory_offer]] event for details.
+
See [[Bot_Playground/Events/inventory_offer| inventory_offer]] event for details.
  
  

Revision as of 16:01, 17 October 2022

Accept (or reject) an inventory offer sent by other avatar or in-world script.

Bot.on("inventory_offer", (event) => {
  Bot.acceptInventoryOffer(
    event.offer_type, 
    event.object_id, 
    event.sender_uuid, 
    event.folder, 
    event.session, 
    true
  );
});

See inventory_offer event for details.


Reference

This command accepts the following parameters:

Variable Required Description


Input:
offer_type yes the type of the inventory offer (from avatar or from in-world script)
object_id yes inventory UUID of the item being offered
sender_uuid yes UUID of the sender
folder yes inventory folder UUID this item goes to
session yes session UUID from the event
accept yes true to accept item, false to reject.
Output:
Function returns a Promise with the following data:
success bool true if command completed successfully
error string error string if command has failed