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

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Accept (or reject) an inventory offer sent by other avatar or in-world script.</onlyinclude> <syntaxhighlight lang="javascript">...")
 
Line 9: Line 9:
 
     event.sender_uuid,  
 
     event.sender_uuid,  
 
     event.folder,  
 
     event.folder,  
     event.session_id,  
+
     event.session,  
 
     true
 
     true
 
   );
 
   );

Revision as of 15:37, 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.item_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:
item_type yes the type of the inventory item
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