How to use the steam-user.EClanRelationship 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 / client.js View on Github external
function joinGroups () {
    const groups = config.get('groups');

    const relations = client.myGroups;
    for (let i = 0; i < groups.length; i++) {
        const id = groups[i];

        let relation = SteamUser.EClanRelationship.None;
        for (const group in relations) {
            if (id != group) {
                continue;
            }

            relation = relations[group];
        }

        if (relation != SteamUser.EClanRelationship.Member) {
            joinGroup(id);
        }
    }
}
github Nicklason / tf2-automatic / app / client.js View on Github external
const groups = config.get('groups');

    const relations = client.myGroups;
    for (let i = 0; i < groups.length; i++) {
        const id = groups[i];

        let relation = SteamUser.EClanRelationship.None;
        for (const group in relations) {
            if (id != group) {
                continue;
            }

            relation = relations[group];
        }

        if (relation != SteamUser.EClanRelationship.Member) {
            joinGroup(id);
        }
    }
}
github Nicklason / tf2-automatic / app / handler / groups.js View on Github external
groups.forEach(function (steamID) {
        if (client.myGroups[steamID] !== SteamUser.EClanRelationship.Member && client.myGroups[steamID] !== SteamUser.EClanRelationship.Blocked) {
            community.getSteamGroup(new SteamID(steamID), function (err, group) {
                if (err) {
                    log.warn('Failed to get group: ', err);
                    return;
                }

                log.info('Not member of group "' + group.name + ' ("' + steamID + '"), joining...');
                group.join(function (err) {
                    if (err) {
                        log.warn('Failed to join group: ', err);
                    }
                });
            });
        }
    });
};
github Nicklason / tf2-automatic / app / handler / groups.js View on Github external
exports.groupRelationChanged = function (steamID, relationship) {
    log.debug('Group relation changed', { steamID: steamID, relationship: relationship });
    if (relationship === SteamUser.EClanRelationship.Invited) {
        const join = groups.indexOf(steamID.getSteamID64()) === -1;

        log.info('Got invited to group ' + steamID.getSteamID64() + ', ' + (join ? 'accepting...' : 'declining...'));
        client.respondToGroupInvite(steamID, groups.indexOf(steamID.getSteamID64()) === -1);
    } else if (relationship === SteamUser.EClanRelationship.Member) {
        log.info('Joined group ' + steamID.getSteamID64());
    }
};