Jump to content
McKay Development

I want my bot to check the user level and then invite him to a group if he is over level 10 but my code doest seem to work


Recommended Posts

Posted
friends.on("friendMsg", function(user, msg, type, details){

  if(type == Steam.EChatEntryType.ChatMsg){

    if(msg == "invite"){

      client.on("getSteamLevels", function(user, callback){

        client.getSteamLevels(user, callback)

        callback(results);

        if(results >= 10){

          client.inviteUserToGroup(user, "steamgroupidhere")

        }

      });

    }

  }

});

 

Thats my code.Whats wrong it with?

Posted (edited)

Why are you trying to listen for a getSteamLevels event?

That was a mistake.This is my current code:

 

friends.on("friendMsg", function(user, msg, type, details){
  if(type == Steam.EChatEntryType.ChatMsg){
    if(msg == "invite"){
      function getSteamLevels(steamids, callback){
        getSteamLevels("config.steamid", results)
        if(results = 11){
          client.inviteToGroup(user, "config.groupid")
          console.log("done");
        }
      }
    }
  }
});
 
Nevermind!Everything is good now.
Edited by cob

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...