What Comes Around Posted February 6, 2020 Report Share Posted February 6, 2020 Hey there, So basically I need to get the steam id to make sure a user does not exploit a system. But for easy of use I chose to use tradeofferurls for users, but how do I get the steamid from the tradeofferurl? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted February 7, 2020 Report Share Posted February 7, 2020 const SteamID = require('steamid'); const URL = require('url'); let link = 'https://steamcommunity.com/tradeoffer/new/?partner=46143802&token=aaaaaaaa'; let steamid = SteamID.fromIndividualAccountID(URL.parse(link, true).query.partner); What Comes Around 1 Quote Link to comment Share on other sites More sharing options...
What Comes Around Posted February 7, 2020 Author Report Share Posted February 7, 2020 3 hours ago, Dr. McKay said: const SteamID = require('steamid'); const URL = require('url'); let link = 'https://steamcommunity.com/tradeoffer/new/?partner=46143802&token=aaaaaaaa'; let steamid = SteamID.fromIndividualAccountID(URL.parse(link, true).query.partner); I couldn't find the answer just looking it up on your site and google, so hopefully this helps anyone with the same question in the future. Thank you very much! Quote Link to comment Share on other sites More sharing options...
What Comes Around Posted February 8, 2020 Author Report Share Posted February 8, 2020 On 2/7/2020 at 6:31 AM, Dr. McKay said: const SteamID = require('steamid'); const URL = require('url'); let link = 'https://steamcommunity.com/tradeoffer/new/?partner=46143802&token=aaaaaaaa'; let steamid = SteamID.fromIndividualAccountID(URL.parse(link, true).query.partner); Hey there, today I managed to try out the code and I have another question. I get: SteamID { universe: 1, type: 1, instance: 1, accountid: 92222221 } when using this function: module.exports.IDFetcher = function(link) { const SteamID = require('steamid'); const URL = require('url'); steamid_of_user = SteamID.fromIndividualAccountID(URL.parse(link, true).query.partner); return steamid_of_user; } So while it gives me the account id, it doesn't convert it to a SteamID, which is something I don't know how to do. I have also tried inputting account id's into SteamID.fromIndividualAccountID but still get an object with what I input. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted February 10, 2020 Report Share Posted February 10, 2020 https://www.npmjs.com/package/steamid What Comes Around 1 Quote Link to comment Share on other sites More sharing options...
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.