<commit_before>const request = require('request');
const SteamClient = require('steam-client');
const SteamCommunity = require('steamcommunity');
const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const TradeOfferManager = require('steam-tradeoffer-manager');

class Bot {
    constructor(config) {
        this.config = config;
        this.tag = `[${config.username}]`;
    }

    async start() {
        const steam = new SteamClient.CMClient();
        if (this.config.proxy) {
            steam.setHttpProxy(`http://${this.config.proxy}`);
        }
        this.client = new SteamUser(steam, {
            promptSteamGuardCode: false,
        });
        console.log(`${this.tag} Logging into Steam client...`);
        await this.loginToSteamClient();
        console.log(`${this.tag} Logged into Steam client with IP ${this.client.publicIP}!`);
        this.community = new SteamCommunity({
            request: request.defaults({
                proxy: this.config.proxy ? `http://${this.config.proxy}` : undefined,
            }),
        });
        this.manager = new TradeOfferManager({
            steam: this.client,
            community: this.community,
            language: 'en',
            cancelTime: 5 * 60 * 1000,
        });
        console.log(`${this.tag} Waiting 30s before logging into Steam Community website...`);
        await new Promise(resolve => setTimeout(resolve, 30 * 1000));
        await this.retryLogin();
        this.community.on('debug', (message) => {
            console.log(`${this.tag} ${message}`);
        });
        this.community.startConfirmationChecker(10000, this.config.identity_secret);
        this.manager.on('newOffer', this.onNewOffer.bind(this));
        setInterval(() => {
            this.manager.getInventoryContents(730, 2, true, this.onInventoryLoaded.bind(this));
        }, 10 * 60 * 1000); // check inventory every 10 minutes and send items to target
    }

    async onInventoryLoaded(err, inventory) {
        if (err) {
            if (err.toString().includes('Failure')) return;
            console.log(`${this.tag} Error loading inventory: ${err}`);<commit_msg>Don't log debug message if it's just checking confirmations<commit_after>const request = require('request');
const SteamClient = require('steam-client');
const SteamCommunity = require('steamcommunity');
const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const TradeOfferManager = require('steam-tradeoffer-manager');

class Bot {
    constructor(config) {
        this.config = config;
        this.tag = `[${config.username}]`;
    }

    async start() {
        const steam = new SteamClient.CMClient();
        if (this.config.proxy) {
            steam.setHttpProxy(`http://${this.config.proxy}`);
        }
        this.client = new SteamUser(steam, {
            promptSteamGuardCode: false,
        });
        console.log(`${this.tag} Logging into Steam client...`);
        await this.loginToSteamClient();
        console.log(`${this.tag} Logged into Steam client with IP ${this.client.publicIP}!`);
        this.community = new SteamCommunity({
            request: request.defaults({
                proxy: this.config.proxy ? `http://${this.config.proxy}` : undefined,
            }),
        });
        this.manager = new TradeOfferManager({
            steam: this.client,
            community: this.community,
            language: 'en',
            cancelTime: 5 * 60 * 1000,
        });
        console.log(`${this.tag} Waiting 30s before logging into Steam Community website...`);
        await new Promise(resolve => setTimeout(resolve, 30 * 1000));
        await this.retryLogin();
        this.community.on('debug', (message) => {
            if (message === 'Checking confirmations') return;
            console.log(`${this.tag} ${message}`);
        });
        this.community.startConfirmationChecker(10000, this.config.identity_secret);
        this.manager.on('newOffer', this.onNewOffer.bind(this));
        setInterval(() => {
            this.manager.getInventoryContents(730, 2, true, this.onInventoryLoaded.bind(this));
        }, 10 * 60 * 1000); // check inventory every 10 minutes and send items to target
    }

    async onInventoryLoaded(err, inventory) {
        if (err) {
            if (err.toString().includes('Failure')) return;
            console.log(`${this.tag} Error loading inventory: ${err}`);
{'fraction_non_alphanumeric': 0.1447841726618705, 'fraction_numerical': 0.015287769784172662, 'mean_word_length': 2.550678371907422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1897821', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1223, 'n_words': 276}