acceptInventoryOffer

From SmartBots Developers Docs
Jump to: navigation, search

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

Bot.on("inventory_offer", (event) => {
  Bot.acceptInventoryOffer(
    event.sender_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:
sender_type yes who sent us an inventory (agent or 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