Ability to send friend requests and get notified on accept
This commit is contained in:
@@ -154,6 +154,18 @@ bot.clientEvents.onGroupInvite.subscribe((GroupInviteEvent) =>
|
||||
});
|
||||
});
|
||||
|
||||
bot.clientEvents.onFriendResponse.subscribe((response) =>
|
||||
{
|
||||
if (response.accepted)
|
||||
{
|
||||
console.log(response.fromName + ' accepted your friend request');
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(response.fromName + ' declined your friend request');
|
||||
}
|
||||
});
|
||||
|
||||
function connect()
|
||||
{
|
||||
console.log("Logging in..");
|
||||
@@ -225,6 +237,8 @@ function connect()
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
bot.clientCommands.comms.sendFriendRequest(master, 'Be friends with me?');
|
||||
|
||||
// When it's time to go home, call bot.close();
|
||||
}).catch((error) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user