Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SteamUser = require('steam-user');
- const SteamTotp = require('steam-totp');
- const SteamCommunity = require('steamcommunity');
- const TradeOfferManager = require('steam-tradeoffer-manager');
- const client = new SteamUser();
- const community = new SteamCommunity();
- const manager = new TradeOfferManager({
- steam: client,
- community: community,
- language: 'en'
- });
- const logOnOptions = {
- accountName: '', //put your steam username here within the quotes
- password: '', //put your steam password here within the quotes
- twoFactorCode: SteamTotp.generateAuthCode('') //put your steam shared secret here within the quotes
- };
- const admin = ''; //your steam id
- client.logOn(logOnOptions);
- client.on('loggedOn', () => {
- console.log('Logged into Steam with the account name of : ' + logOnOptions.accountName);
- let tf2 = 440;
- let csgo = 730;
- client.setPersona(SteamUser.Steam.EPersonaState.Online);
- client.gamesPlayed(tf2); //here you can put csgo or tf2
- });
- client.on('webSession', (sessionid, cookies) => {
- manager.setCookies(cookies);
- community.setCookies(cookies);
- community.startConfirmationChecker(10000, ''); //put your steam identity secret here within the quotes
- console.log("Connected to steam with the session id of : " + sessionid);
- });
- manager.on('newOffer', (offer) => {
- console.log("New offer #" + offer.id + " from " + offer.partner);
- if(offer.itemsToGive.length == 0 || offer.partner.getSteamID64() === admin){
- console.log("Offer is either a donation or trade from admin.");
- offer.accept((err, status) => {
- if (err) {
- console.log(err);
- } else {
- console.log('Donation accepted.');
- }
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement