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

From SmartBots Developers Docs
Jump to: navigation, search
 
Line 5: Line 5:
 
Bot.on("inventory_offer", (event) => {
 
Bot.on("inventory_offer", (event) => {
 
   Bot.acceptInventoryOffer(
 
   Bot.acceptInventoryOffer(
     event.offer_type,  
+
     event.sender_type,  
 
     event.object_id,  
 
     event.object_id,  
 
     event.sender_uuid,  
 
     event.sender_uuid,  
Line 22: Line 22:
  
 
{{API Variable Group|Input}}
 
{{API Variable Group|Input}}
{{API Variable| offer_type |yes}} the type of the inventory offer (from avatar or from in-world script)
+
{{API Variable| sender_type |yes}} who sent us an inventory (agent or in-world script)
 
{{API Variable| object_id |yes}} inventory UUID of the item being offered
 
{{API Variable| object_id |yes}} inventory UUID of the item being offered
 
{{API Variable| sender_uuid |yes}} UUID of the sender
 
{{API Variable| sender_uuid |yes}} UUID of the sender

Latest revision as of 16:06, 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.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