friendship_offer
From SmartBots Developers Docs
Revision as of 16:31, 17 October 2022 by Gg (Talk | contribs) (Created page with "{{DISPLAYTITLE:friendship_offer}} <onlyinclude>Fires when bot receives a friendship offer</onlyinclude> <syntaxhighlight lang="javascript"> Bot.on("friendship_offer", functio...")
Fires when bot receives a friendship offer
Bot.on("friendship_offer", function(event) { ... });
offer_friendship: {"name":"offer_friendship","bot_slname":"Fashion Firethorn","bot_uuid":"13e0bc21-bc8d-4c8e-8354-19965817dee6",,"":"Vikky Dryke","":"042536ca-dc19-45ef-bd3c-2f3c829d4e56","":"df65047c-7e93-d33a-dcfa-ca4ad3599c28"}
Reference
This event comes with the following event object:
Variable | Required | Description | |
---|---|---|---|
event object properties: | |||
avatar_name | name of the sender | ||
avatar_uuid | UUID of the sender | ||
message | Text message sent along with the offer | ||
session_id | Session UUID to accept an offer. |
Example
Bot.on("friendship_offer", function(event) {
console.log(`Friendship offfer from ${event.avatar_name}`);
});
console.log("Bot is listening to friendship offers");