Jump to content


Photo
Question

community.getSteamUser is not a function -- help please

node.js node-steamcommunity

  • Please log in to reply
2 replies to this topic

#1 Snavellet

Snavellet

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 20 May 2019 - 06:56 AM

client.on('friendRelationship', (sid, relationship) => {
if(relationship == SteamUser.EFriendRelationship.RequestRecipient) {
console.log(`Friend request from: ${sid.getSteamID64()}`)
console.log(`Checking if ${sid.getSteamID64()} is scammer.`)
rep.isScammer(sid.getSteamID64(), function(error, result) {
if(error) {
console.log(error);
} else {
if(result) {
console.log(`Declining friend request, ${sid.getSteamID64()} is a scammer.`);
client.removeFriend(sid)
} else {
console.log(`Accepting friend request, ${sid.getSteamID64()} is not a scammer.`);
community.getSteamUser(sid, (err, user) => {
if(err) {
console.error(err)
} else {
user.comment('test')
}
})
}
}
});
}
});

 



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,101 posts

Posted 21 May 2019 - 04:31 PM

If I had to guess, I'd say that community isn't an instance of SteamCommunity.



#3 CellSplitter

CellSplitter

    Member

  • Member
  • PipPip
  • 20 posts

Posted 31 May 2019 - 04:39 PM

// Set this to your Imports
let SteamCommunity = require("steamcommunity");

U must install it with "npm i steamcommunity", if u have a package.json file u can save it with "--save" after "npm i steamcommunity --save"

// Then make community instance of SteamCommunity

let community = new SteamCommunity();

Thats all ;)

Edited by CellSplitter, 31 May 2019 - 04:39 PM.






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

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users