Jump to content
McKay Development

harsh

Member
  • Posts

    10
  • Joined

  • Last visited

Posts posted by harsh

  1. On 1/16/2022 at 4:05 AM, Dr. McKay said:

    Because you're mixing up async and sync. forEach returns before your requests complete.

    Also, rather than looping through the friend list, you should split it into chunks of 100 and make one request per chunk, to avoid getting rate limited by the API.

    can you give an example of 100 steamids passing in api

    like i have 256 friends

  2. why vac_friends list is empty when I print at last ?
     

    function checkVacID(){
        friend_list = friends;
        vac_friends = []
        friend_list.forEach(function(key, index){ 
            
            axios.get(`https://api.steampowered.com/ISteamUser/GetPlayerBans/v1/?key=&steamids=${key}`)
    
            .then(function (response) {
                vac_response = response.data;
                if(vac_response.players[0]['VACBanned'] == true){
                   vac_friends.push(vac_response.players[0])
                   console.log(vac_friends)
                }
              })
              .catch(function (error) {
                console.log(error);
              })
        });
    
        console.log(vac_friends)
    }

     

  3. Its flooding with error in console

     

    there was an problem to get the steam user!
    there was an problem to get the steam user!
    there was an problem to get the steam user!
    there was an problem to get the steam user!
    there was an problem to get the steam user!
    there was an problem to get the steam user!



    Edit: when i print err it shows this
     

    Error: The specified profile could not be found.

     

  4. whats wrong , i am running it through list of steamids.

    Here is my code:-

    function checkVacID(){
    
        friend_list = friends;
    
        friend_list.forEach(function(key, index){ 
            community.getSteamUser(key, (err, user) => {
                    if(err) { 
                        console.log("there was an problem to get the steam user!"+err) 
                        return; 
                    }
                    else
                    {
                        if(user.vacBanned == true)
                        {
                            console.log(`${user.name} VAC Banned Profile`);  
                        }
                    }
                });
        });
    }

     

  5. What will be the best way to get friend list with steam id?

     

    client.on('friendsList', async function () {
           var friends=[];
    
            async function getAllFriends(){
                var temp = [];
                for (var key in client.myFriends)
                    temp.push(key);
               
                return temp;
            }
    
            friends = await getAllFriends();
            console.log("[Steam Bot] All Friends: "+friends.length);
    });

    OR
    Using WebAPI
     

    https://api.steampowered.com/ISteamUser/GetFriendList/v1/?key=XXXXXXXXXXXXXXXXXXXX&steamid=76561198872686120

     

×
×
  • Create New...