Jump to content


Photo
Question

postUserComment help please

node.js node-steamcommunity

  • Please log in to reply
1 reply to this topic

#1 Mr_wall1122

Mr_wall1122

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 11 July 2017 - 05:00 PM

please help when i call postUserComment it says the settings on this account do not allow you to add comments, but i can manually add comments , here is all my code, please HELP!!

 

const TradeOfferManager = require('steam-tradeoffer-manager');
const SteamCommunity = require('steamcommunity');
var steamParental = require('steam-parental');
const SteamUser = require('steam-user');
var prompt = require('prompt');
var math = require('mathjs');
 
require('console-stamp')(console, '[HH:MM:ss]');
 
const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager ({
steam: client,
community: community,
language: 'en'
});
 
var schema = {
    properties: {
      Account_Name: {
 
      },
      Password: {
        hidden: true,
        replace: '*'
      },
    }
  };
 
  prompt.start();
 
  prompt.get(schema, function (err, result) {
 
    // console.log('  name: ' + result.AccountName);
    // console.log('  password: ' + result.Password);
 
    const logOnOptions = {
accountName: result.Account_Name,
password: result.Password,
};
// Disables asking for Steam Guard Code
client.setOption("promptSteamGuardCode", true);
 
client.logOn(logOnOptions);
 
client.on('loggedOn', () => {
client.on("accountInfo", function(name, country) {
   console.log(' ');
console.log('-----------------------------------');
console.log('Succesfully logged in as: ' + result.Account_Name);
console.log("Your Online Name: " + name);
console.log("Your Country: " + country);
console.log('-----------------------------------');
console.log('Now Blocking Group Invites');
console.log('-----------------------------------');
console.log(' ');
client.setPersona(SteamUser.Steam.EPersonaState.Online);
client.gamesPlayed(["BOT TESTING",271590]);
// client.gamesPlayed(271590); //Playing GTA 5
 
client.on('webSession', (sessionid, cookies) => {
manager.setCookies(cookies);
community.setCookies(cookies);
 
});
 
var Dets = {
    properties: {
      SteamID64: {
 
      },
      comment: {
 
      },
      times: {
 
      },
    }
  };
 
  prompt.start();
 
  prompt.get(Dets, function (err, result) {
  // console.log("SteamID64: " + result.SteamID64);
  // console.log("what to comment: " + result.comment);
  // console.log("how many times: " + result.times);
 
      for(var i = 0; i < result.times;i++){
  community.postUserComment(76561198398342583, 'test', (err) => { 
  console.log(err);
  }
        
  );
};
});
});
});
});
 
client.on('groupRelationship', function (steamID, relationship) {
if (relationship == SteamUser.Steam.EClanRelationship.Invited){
//console.log("Succesfully Decline Group Invite From" + " " + steamID);
client.respondToGroupInvite(steamID, false);
console.log("Declined Steam Group Invite");
}
});
 
client.on("friendMessage", function(steamID, message, type) {
client.getPersonas([steamID], function(personas) {
var persona = personas[steamID];
var name = persona ? persona.player_name : ("[" + steamID + "]");
console.log("Friend message from " + name + ": " + message);
 
});
});
// client.on('friendRelationship', function(steamID, relationship) {
 
//     if (relationship == SteamUser.Steam.EFriendRelationship.RequestRecipient) {
//         client.addFriend(steamID);
//         console.log(" ");
//         console.log("Accepted friend request from: " + steamID);
//         client.chatMessage(steamID, "Welcome To My Bot, type !help to get started!");
//     }
//     });
 
// client.on('friendRelationship', function(steamID, relationship) {
 
//     if (relationship == SteamUser.Steam.EFriendRelationship.None) {
//     console.log(" ");
//         console.log("you have been deleted by: " + steamID);
//         }
//     });
 
// client.on("newComments", function(count) {
// console.log("You have " + count + " new comments on your profile");
// });
 
// client.on("newItems", function(count) {
// console.log("You have " + count + " new items in your inventory");
// });
 
// client.on("tradeOffers", function(count) {
// console.log("You have " + count + " new trade offers");
// });
 
// client.on("offlineMessages", function(count) {
// console.log("You have " + count + " unread messages");
// });
 
client.on("friendMessage", function(steamID, message) {
if (message == "!help") {
client.chatMessage(steamID, "Type !starwars for a cool quote");
}
});
 
client.on("friendMessage", function(steamID, message) {
if (message == "!help") {
client.chatMessage(steamID, "Type !csgo for something funny");
}
});
 
client.on("friendMessage", function(steamID, message) {
if (message == "!starwars") {
client.chatMessage(steamID, "The Force will be with you. Always. — Obi-Wan Kenobi");
}
});
 
client.on("friendMessage", function(steamID, message) {
if (message == "!csgo") {
client.chatMessage(steamID, "You bought the game for russain lessons, right?");
}
});
// This will fire when we receive a chat message from ANY friend
// client.on('friendMessage', function(steamID, message) {
// console.log("Friend message from " + steamID.getSteam3RenderedID() + ": " + message);
// });


#2 Vanilla

Vanilla

    Member

  • Member
  • PipPip
  • 29 posts
  • LocationIndonesia

Posted 13 July 2017 - 09:15 AM

Don't use 'err' callback







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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users