How to use the steam-user.EFriendRelationship function in steam-user

To help you get started, we’ve selected a few steam-user examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Nicklason / tf2-automatic / app.js View on Github external
function loginResponse (err) {
                if (err) {
                    if (!lastLoginFailed && err.eresult !== SteamUser.EFriendRelationship.RateLimitExceeded && err.eresult !== SteamUser.EFriendRelationship.InvalidPassword) {
                        lastLoginFailed = true;
                        // Try and sign in without login key
                        log.warn('Failed to sign in to Steam, retrying without login key...');
                        login(null, loginResponse);
                    } else {
                        log.warn('Failed to sign in to Steam');
                        handler.onLoginFailure(err);
                    }
                    return;
                }

                checkAccountLimitations(function (err) {
                    if (err) {
                        throw err;
                    }
github antigravities / Steamcord / index.js View on Github external
steam.on("friendRelationship", (sender, relationship) => {
	var profile = tryGetProfile(sender);

	var msg = "\*\* " + profile.name + " ";

	if( relationship == Steam.EFriendRelationship.None ){
		msg+= "❌ removed you.";
	} else if( relationship == Steam.EFriendRelationship.RequestRecipient ){
		msg+= "✅ sent a friend invite.";
	} else if( relationship == Steam.EFriendRelationship.Friend ){
		msg+= "✅ is now your friend.";
	} else if( relationship == Steam.EFriendRelationship.Ignored || relationship == Steam.EFriendRelationship.IgnoredFriend ){
		msg+="❌ ignored you.";
	} else if( relationship == Steam.EFriendRelationship.Blocked ){
		msg+="❌ blocked you.";
	}

	sendMessageAs(sender, msg);
});
github antigravities / Steamcord / index.js View on Github external
}

						steamids.push(id);

						if( steam.myFriends[id] == Steam.EFriendRelationship.Friend ){
							if( steam.users[id].persona_state == Steam.EPersonaState.Offline ) states.push("Offline");
							else if( steam.users[id].persona_state == Steam.EPersonaState.Online ) states.push("Online");
							else if( steam.users[id].persona_state == Steam.EPersonaState.Busy ) states.push("Busy");
							else if( steam.users[id].persona_state == Steam.EPersonaState.Away ) states.push("Away");
							else if( steam.users[id].persona_state == Steam.EPersonaState.Snooze ) states.push("Snooze");
							else if( steam.users[id].persona_state == Steam.EPersonaState.LookingToPlay ) states.push("Looking to Play");
							else if( steam.users[id].persona_state == Steam.EPersonaState.LookingToTrade ) states.push("Looking to Trade");
							else states.push("Offline");
						} else {
							if( steam.myFriends[id] == Steam.EFriendRelationship.RequestRecipient ) states.push("Added you as a friend");
							else if ( steam.myFriends[id] == Steam.EFriendRelationship.Ignored ) states.push("Blocked");
							else states.push("??");
						}
					});
github Nicklason / tf2-automatic / app / friends.js View on Github external
function getFriends () {
    const friends = [];
    for (const steamID64 in client.myFriends) {
        if (!client.myFriends.hasOwnProperty(steamID64)) {
            continue;
        }

        const relation = client.myFriends[steamID64];
        if (relation == SteamUser.EFriendRelationship.Friend) {
            friends.push(steamID64);
        }
    }

    return friends;
}
github frej4189 / steam-games-bot / utils / steam.js View on Github external
client.on('friendsList', () => {
		let friends = client.myFriends;

		for(let friend in friends) {
			if(friends.hasOwnProperty(friend)) {
				let state = friends[friend];

				if(state == SteamUser.EFriendRelationship.RequestRecipient)
					client.addFriend(friend);
			}
		}
	});
}
github Nicklason / tf2-automatic / app / handler / friends.js View on Github external
exports.friendRelationChanged = function (steamID, relationship) {
    if (relationship === SteamUser.EFriendRelationship.Friend) {
        onNewFriend(steamID);
        checkFriendsCount(steamID);
    } else if (relationship === SteamUser.EFriendRelationship.RequestRecipient) {
        respondToFriendRequest(steamID);
    }
};
github Nicklason / tf2-automatic / app / handler / friends.js View on Github external
function getFriends () {
    const friends = [];
    for (const steamID in client.myFriends) {
        if (!Object.prototype.hasOwnProperty.call(client.myFriends, steamID)) {
            continue;
        }

        const relation = client.myFriends[steamID];
        if (relation === SteamUser.EFriendRelationship.Friend) {
            friends.push(steamID);
        }
    }

    return friends;
}
github frej4189 / steam-games-bot / utils / steam.js View on Github external
client.on('friendRelationship', (sid, relationship) => {
	if(relationship == SteamUser.EFriendRelationship.RequestRecipient)
		client.addFriend(sid);

	if(relationship == SteamUser.EFriendRelationship.Friend) {
		exports.message(sid, "Thanks for adding me, type !help to get started.");
		offers.inviteUserToGroup(sid);
	}
});