Closed iTzxBeaTz closed 8 years ago
steamFriends.on('friend', function(source, type) {
//auto accept friend requests
if(type == Steam.EFriendRelationship.RequestRecipient) {
console.log("Accepted a friend request from: " + source);
steamFriends.addFriend(source);
}
});
To accept them when your bot is online.
steamFriends.on('relationships', function() {
for (var prop in steamFriends.friends) {
if (steamFriends.friends.hasOwnProperty(prop)) {
if (steamFriends.friends[prop] == 2) {
steamFriends.addFriend(prop);
console.log("Accepted a friend request from (offline): " + prop);
}
}
}
});
To accept them when the invitations were sent while the bot was offline.
@iTzxBeaTz your code is for v0.6. See the release notes for relevant changes.
i have the newest version. Trade Offers works, sending messages works fine. But Accepting Friend Requests doesnt work...
Hey, i want to accept friend requests. BUT i searched here and all what i founded doesnt work.
steam.on('relationships', function() { for (var friend in steam.friends) { console.log('User: ' + friend); if (steam.friends[friend] == 2) { client.addFriend(friend); console.log('SteamID ' + friend + ' added!') } } });
this doesnt work. I changed everything on this code to make it work. But i failed.
i hope anyone can help me.