Ability to send friend requests and get notified on accept

This commit is contained in:
Casper Warden
2017-12-19 20:25:42 +00:00
parent 70fd5a99ce
commit 58b29d8893
16 changed files with 161 additions and 5 deletions

View File

@@ -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) =>
{