Difference between revisions of "Bot Playground/Commands/acceptInventoryOffer"
From SmartBots Developers Docs
Line 5: | Line 5: | ||
Bot.on("inventory_offer", (event) => { | Bot.on("inventory_offer", (event) => { | ||
Bot.acceptInventoryOffer( | Bot.acceptInventoryOffer( | ||
− | event. | + | event.offer_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| | + | {{API Variable| offer_type |yes}} the type of the inventory offer (from avatar or from 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 |
Revision as of 16:00, 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.offer_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: | |||
offer_type | yes | the type of the inventory offer (from avatar or from 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 |