tf2forever Posted June 2, 2021 Report Posted June 2, 2021 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! Quote
Dr. McKay Posted June 2, 2021 Report Posted June 2, 2021 All I can figure is that you aren't referencing your config properly, and config.clanid is ending up as undefined. Quote
tf2forever Posted June 2, 2021 Author Report Posted June 2, 2021 2 hours ago, Dr. McKay said: All I can figure is that you aren't referencing your config properly, and config.clanid is ending up as undefined. Should the "clanid" be a string or a number? Quote
tf2forever Posted June 3, 2021 Author Report Posted June 3, 2021 (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 June 3, 2021 by tf2forever Make it more clear Quote
Dr. McKay Posted June 3, 2021 Report Posted June 3, 2021 Sounds like you need to pass a callback and check if Steam is returning an error. tf2forever 1 Quote
tf2forever Posted June 3, 2021 Author Report Posted June 3, 2021 I get null as the callback, but I don't think I'm doing it correctly. community.postGroupComment(gid, content, callback => { console.log(callback) }); Quote
apibot Posted June 5, 2021 Report Posted June 5, 2021 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) Quote
tf2forever Posted June 5, 2021 Author Report Posted June 5, 2021 I think I know why my comment isn't posting. https://steamcommunity.com/discussions/forum/7/35221584661887522/ Thanks for trying to help me, but the problem was actually to do with the account. But can one of you please show me how to do a callback so I know how to do one in the future? Quote
apibot Posted June 5, 2021 Report Posted June 5, 2021 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) }); community.postGroupComment(gid, content, () => { }); tf2forever 1 Quote
tf2forever Posted June 6, 2021 Author Report Posted June 6, 2021 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. Quote
Dr. McKay Posted June 7, 2021 Report Posted June 7, 2021 I don't see you ever calling setCookies on your community instance. And if you are, you have to call postGroupComment after that, not before. Quote
tf2forever Posted June 8, 2021 Author Report Posted June 8, 2021 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) }); }); Quote
Recommended Posts
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.