Jump to content
McKay Development

Igaresha

Member
  • Posts

    3
  • Joined

  • Last visited

Igaresha's Achievements

  1. Hello guys. I've got a problem which i cant decide by myself.. First problem was that my bot was going offline with no reason, but i decided it And now i got the second problem: After few hours (sometimes days) bot asking for steam guard code. In console it looks like: "Steam Guard Code:". Guys, need your help Thanks. Code: const config = require("./config.js"); const Config = require('config-js'); 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' // Может быть любой язык }); // Log in to account with config.js const logOnOptions = { "accountName": config.steam.username, "password": config.steam.password, "twoFactorCode": SteamTotp.generateAuthCode(config.steam.twoFactorCode) }; client.logOn(logOnOptions); // After success login client.on('loggedOn', () => { console.log('Bot succesfully authorized!'); client.setPersona(SteamUser.Steam.EPersonaState.Online, config.steam.botname); console.log('Bot status changed to "Online"'); }); // Thats how i solve problem with going offline community.on('sessionExpired', function(err) { if (err) { console.log('sessionExpired: '+err); } community.stopConfirmationChecker(); if (client.steamID) { client.webLogOn(); } else { client.logOn(logOnOptions); } }); // Thats my way to solve second problem, but it didnt help. client.on("steamGuard", function(domain, callback, lastCodeWrong) { if(lastCodeWrong) { console.log("Last code wrong, try again!"); setTimeout(function() { callback(SteamTotp.getAuthCode(config.steam.twoFactorCode)); }, 30000); } });
  2. Hello guys, i've got a problem which my brain cant solve Bot should send message to admin (via steam chat) after accepting trade offer (for example), but he dont do it.. Thats my not working code: manager.on('newOffer', (offer) => { if (offer.itemsToGive.length === 0) { offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`[!]Trade Accepted! Status: ${status}.`); client.chatMessage(76561198074539527, 'Trade accepted! Check bot's inventory!'); }
×
×
  • Create New...