Jump to content
McKay Development

[Help] Group comment not posting


Recommended Posts

I'm trying to post a comment on my group (https://steamcommunity.com/groups/testingwall) but it's not working for some weird reason.
 

const content = "hello world";
const gid = config.clanid;
community.postGroupComment(gid, content);

This is the "clanid" in my config:

{
    [..]
    "clanid": "103582791470169702"
}

This is the error I'm getting when I run the program
 

[..]\Bot\node_modules\steamcommunity\components\groups.js:611
                "uri": "https://steamcommunity.com/comment/Clan/post/" + gid.getSteamID64() + "/-1/",
                                                                             ^

TypeError: Cannot read property 'getSteamID64' of undefined
    at SteamCommunity.postGroupComment ([..]\Bot\node_modules\←[4msteamcommunity←[24m\components\groups.js:611:64)

Please help me!

Link to comment
Share on other sites

Posted (edited)

I only get the error when the "clanid" is a number, probably because it doesn't pass the if statement which turns it into a steamID object.

When "clanid" is a string, I don't get an error but it doesn't comment.

 

Edit:

config.clanid doesn't turn up as undefined.

Edited by tf2forever
Make it more clear
Link to comment
Share on other sites

On 6/3/2021 at 2:26 PM, tf2forever said:

I only get the error when the "clanid" is a number, probably because it doesn't pass the if statement which turns it into a steamID object.

When "clanid" is a string, I don't get an error but it doesn't comment.

 

Edit:

config.clanid doesn't turn up as undefined.

I'm suspecting that somewhere in your code, clanid gets manipulated like parsing it as an integer.

Know that:

parseInt(103582791470169702) != 103582791470169702

parseInt("103582791470169702") != "103582791470169702"

parseInt(103582791470169702) == parseInt(103582791470169702)

 

Link to comment
Share on other sites

On 6/3/2021 at 6:06 PM, tf2forever said:

I get null as the callback, but I don't think I'm doing it correctly.

 

community.postGroupComment(gid, content, callback => {
    console.log(callback)
});

:unsure:

community.postGroupComment(gid, content, () => {
});

 

Link to comment
Share on other sites

ok ok i don't think this issue has been resolved. i tried using the function with my main account, which is level 30 and isn't restricted, and it still doesn't work.

this is my code:
 

const SteamUser = require("steam-user");
const SteamTotp = require("steam-totp");
const SteamCommunity = require('steamcommunity');

let content = "hello world";
const gid = "103582791470169702";

const client = new SteamUser();
const community = new SteamCommunity();

const logOnOptions = {
  accountName: "",
  password: "",
  twoFactorCode: SteamTotp.generateAuthCode("")
}

client.logOn(logOnOptions);

client.on("loggedOn", () => {
  console.log("[-] Logged On");

  community.postGroupComment(String(gid), content, (callback) => {
     console.log(callback)
  });
});

i get null as when printing the callback, which makes me think i'm doing something wrong. also, i ran this script multiple times and it has never worked.

Link to comment
Share on other sites

Updated my code, but it's still not working.

 

const SteamUser = require("steam-user");
const SteamTotp = require("steam-totp");
const SteamCommunity = require('steamcommunity');

let content = "hello world";
const gid ="103582791470169702"

const client = new SteamUser();
const community = new SteamCommunity();

const logOnOptions = {
  accountName: "",
  password: "",
  twoFactorCode: SteamTotp.generateAuthCode("")
}

client.logOn(logOnOptions);

client.on("loggedOn", () => {
  console.log("[-] Logged On");
});

client.on("webSession", (sessionid, cookies) => {
  manager.setCookies(cookies);

  community.setCookies(cookies);
  community.startConfirmationChecker(20000, config.identitySecret);
    community.postGroupComment(gid, content, (callback) => {
 	console.log(callback)
  });
});

 

Link to comment
Share on other sites

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...
 Share

×
×
  • Create New...