Jump to content


Photo
Discussion

How to use uploadAvatar function?

node.js node-steamcommunity

  • Please log in to reply
4 replies to this topic

#1 berkerm4n

berkerm4n

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 26 September 2017 - 03:29 PM

community.uploadAvatar({
"format": "jpg"
})
i tried it but it doesn't work. Anyone can help me please.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,815 posts

Posted 26 September 2017 - 05:25 PM

You should provide the arguments as arguments, not as an object.



#3 berkerm4n

berkerm4n

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 27 September 2017 - 08:40 AM

You should provide the arguments as arguments, not as an object.

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const SteamCommunity = require('steamcommunity');
const community = new SteamCommunity();
const client = new SteamUser();
 
 
const logOnOptions = {
accountName: 'myid',
password: 'mypw',
twoFactorCode: SteamTotp.generateAuthCode('mysharedsecret')
};
 
client.logOn(logOnOptions);
 
client.on('loggedOn', () => {
console.log('Logged into Steam');
});
 
I used this code but i get this error.
c:\testbot>node index.js
Logged into Steam
c:\testbot\node_modules\steamcommunity\components\profile.js:312
                                "sId": self.steamID.getSteamID64(),
                                                   ^
 
TypeError: Cannot read property 'getSteamID64' of undefined
    at doUpload (c:\testbot\node_modules\steamcommunity\components\profile.js:312:24)
    at SteamCommunity.<anonymous> (c:\testbot\node_modules\steamcommunity\components\profile.js:243:4)
    at Request._callback (c:\testbot\node_modules\steamcommunity\components\http.js:67:15)
    at Request.self.callback (c:\testbot\node_modules\request\request.js:186:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (c:\testbot\node_modules\request\request.js:1163:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (c:\testbot\node_modules\request\request.js:1085:12)


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,815 posts

Posted 27 September 2017 - 05:26 PM

You aren't logging into node-steamcommunity.



#5 SpiTik

SpiTik

    Advanced Member

  • Member
  • PipPipPip
  • 32 posts

Posted 31 July 2018 - 03:38 PM

 
client.on('webSession', (sessionid, cookies) => {
  community.setCookies(cookies),
  community.startConfirmationChecker(10000);
});

𝓢𝓟𝓘𝓣𝓘𝓚






Also tagged with one or more of these keywords: Discussion, node.js, node-steamcommunity

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users