Difference between revisions of "Bot Playground/Events/inventory offer"
From SmartBots Developers Docs
(3 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
{{API Event Table}} | {{API Event Table}} | ||
{{API Variable Group|''event'' object properties}} | {{API Variable Group|''event'' object properties}} | ||
− | {{API Variable|name}} | + | {{API Variable|name}} name of the event in this case inventory_offer |
− | {{API Variable|item_type}} | + | {{API Variable|item_type}} type of the inventory item eg: |
− | {{API Variable|folder}} | + | * Notecard, |
− | {{API Variable|sender_type}} | + | * Object, |
− | {{API Variable|sender_name}} | + | * Landmark... |
− | {{API Variable|sender_uuid}} | + | {{API Variable|folder}} inventory folder UUID this item goes to |
− | {{API Variable|item_name}} | + | {{API Variable|sender_type}} type of the sender AGENT or OBJECT |
− | {{API Variable|object_id}} | + | {{API Variable|sender_name}} name of the sender |
+ | {{API Variable|sender_uuid}} UUID of the sender | ||
+ | {{API Variable|item_name}} name of the offered item | ||
+ | {{API Variable|object_id}} inventory UUID of the item being offered | ||
{{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 Variable|session}}Session UUID to accept the item. |
Latest revision as of 16:05, 17 October 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 | name of the event in this case inventory_offer | ||
item_type | type of the inventory item eg:
| ||
folder | inventory folder UUID this item goes to | ||
sender_type | type of the sender AGENT or OBJECT | ||
sender_name | name of the sender | ||
sender_uuid | UUID of the sender | ||
item_name | name of the offered item | ||
object_id | inventory UUID of the item being offered | ||
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");