Receive and respond to friend requests and inventory offers
This commit is contained in:
@@ -51,6 +51,34 @@ bot.clientEvents.onInstantMessage.subscribe((IMEvent) =>
|
||||
}
|
||||
});
|
||||
|
||||
bot.clientEvents.onFriendRequest.subscribe((event) =>
|
||||
{
|
||||
if (event.from.toString() === master)
|
||||
{
|
||||
console.log("Accepting friend request from " + event.fromName);
|
||||
bot.clientCommands.comms.acceptFriendRequest(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Rejecting friend request from " + event.fromName);
|
||||
bot.clientCommands.comms.rejectFriendRequest(event);
|
||||
}
|
||||
});
|
||||
|
||||
bot.clientEvents.onInventoryOffered.subscribe((event) =>
|
||||
{
|
||||
if (event.from.toString() === master)
|
||||
{
|
||||
console.log("Accepting inventory offer from " + event.fromName);
|
||||
bot.clientCommands.comms.acceptInventoryOffer(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Rejecting inventory offer from " + event.fromName);
|
||||
bot.clientCommands.comms.rejectInventoryOffer(event);
|
||||
}
|
||||
});
|
||||
|
||||
bot.clientEvents.onDisconnected.subscribe((DisconnectEvent) =>
|
||||
{
|
||||
isConnected = false;
|
||||
|
||||
Reference in New Issue
Block a user