Jump to content
McKay Development

takken

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by takken

  1. Hello, im trying to handle an InvalidPassword error.

    const login = (username, password) => {
    		const logOnOptions = {
    			accountName: username,
    			password: password
    		}
    
    		try{
    			client.logOn(logOnOptions);
    		} catch(err) {
    			console.log("Can't find the account. Please double check it.");
    		}
    		
    	}
    
    login(argum, password);

    But instead of showing "Can't find the account..." etc, it shows that

    events.js:174
          throw er; // Unhandled 'error' event
          ^
    
    Error: InvalidPassword
        at SteamUser.<anonymous> (/home/tanjil/projects/nodejs-projects/steam-farm/node_modules/steam-user/components/logon.js:494:16)
        at handlers.forEach (/home/tanjil/projects/nodejs-projects/steam-farm/node_modules/steam-user/components/classes/HandlerManager.js:37:12)
        at Array.forEach (<anonymous>) etc...

     

  2. I wanna make a bot wich responds randomly when the user typer !random, i have created a array with the  example: 

     var random = ["random","blabla","bla"]

     So i added the function:

     

    function random_sentences(random) {
        return random[Math.floor(Math.random()*random.length)];
    }

     

    and if anyones type !random:

     

     else if(message == "!random"{

            client.chatMessage(random_sentences(random))
         }

     

    this error appears:

                    throw new Error("Unknown SteamID input format \"" + input + "\"");
                    ^
     
    Error: Unknown SteamID input format
     
    I did like to know how the bot can reponse randomly.
    Thanks
×
×
  • Create New...