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

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Accept (or reject) an inventory invitation sent by other avatar or in-world script.</onlyinclude> <syntaxhighlight lang="javascr...")
 
Line 8: Line 8:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
See [[/HTTP_API/Bot_Commands/set_http_callback/HTTP_Bot_Callback_Events/offer_friendship|offer_friendship HTTP callback]] for event details.
+
See [[/Bot_Playground/Events/friendship_offer| friendship_offer event]] for details.
  
  

Revision as of 17:14, 15 October 2022

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

Bot.on("friendship_offer", (event) => {
  Bot.offerFriendship(event.avatar_uuid, event.session_id, true);
});

See friendship_offer event for details.


Reference

This command accepts the following parameters:

Variable Required Description


Input:
avatar_uuid yes sender avatar UUID
session_id yes session UUID from the event
accept yes true to accept invitation, 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