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

From SmartBots Developers Docs
Jump to: navigation, search
Line 4: Line 4:
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
Bot.on("friendship_offer", (event) => {
 
Bot.on("friendship_offer", (event) => {
   Bot.acceptFriendship(event.avatar_uuid, event.session_id, true);
+
   Bot.acceptFriendshipOffer(event.avatar_uuid, event.session_id, true);
 
});
 
});
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 16:38, 17 October 2022

Accept (or reject) a friendship offer sent by other avatar.

Bot.on("friendship_offer", (event) => {
  Bot.acceptFriendshipOffer(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 an offer, 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