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

From SmartBots Developers Docs
Jump to: navigation, search
Line 10: Line 10:
 
{{API Variable|name}}The name of the event in this case inventory_offer
 
{{API Variable|name}}The name of the event in this case inventory_offer
 
{{API Variable|item_type}}The type of the inventory item eg: Notecard, Object, Landmark...
 
{{API Variable|item_type}}The type of the inventory item eg: Notecard, Object, Landmark...
 +
{{API Variable|folder}}Inventory folder UUID this item goes to
 
{{API Variable|sender_type}}The type of the sender AGENT or OBJECT
 
{{API Variable|sender_type}}The type of the sender AGENT or OBJECT
 
{{API Variable|sender_name}}The name of the sender
 
{{API Variable|sender_name}}The name of the sender
Line 16: Line 17:
 
{{API Variable|object_id}}The UUID of the offered item.
 
{{API Variable|object_id}}The UUID of the offered item.
 
{{API Variable|item_creator}}The UUID of the creator from the invetory item.
 
{{API Variable|item_creator}}The UUID of the creator from the invetory item.
 +
{{API Variable|session}}Session UUID to accept the item.
  
 
{{API Variables Table End}}
 
{{API Variables Table End}}

Revision as of 19:10, 10 September 2022

Fires when bot receives a inventory offer

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

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
name The name of the event in this case inventory_offer
item_type The type of the inventory item eg: Notecard, Object, Landmark...
folder Inventory folder UUID this item goes to
sender_type The type of the sender AGENT or OBJECT
sender_name The name of the sender
sender_uuid The UUID of the sender
item_name The name of the offered item.
object_id The UUID of the offered item.
item_creator The UUID of the creator from the invetory item.
session Session UUID to accept the item.

Example

Bot.on("inventory_offer", function(event) {
	console.log(event.sender_name + " send me an " + event.item_type + " with the name: \n" + event.item_name);
});

console.log("Bot is listening to inventory offers");