Skip to content

Commit

Permalink
Version 2.15.4
Browse files Browse the repository at this point in the history
Merge pull request #262
  • Loading branch information
3urobeat authored Oct 13, 2024
2 parents 199aa8a + e1db574 commit 57a0338
Show file tree
Hide file tree
Showing 34 changed files with 813 additions and 980 deletions.
2 changes: 1 addition & 1 deletion advancedconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"retryFailedComments": false,
"retryFailedCommentsDelay": 300000,
"retryFailedCommentsAttempts": 1,
"commentsIpCooldownPenalty": 300000,
"requestsIpCooldownPenalty": 300000,
"lastQuotesSize": 5,
"dummy3": "------------------- Debug Settings: -------------------",
"enableevalcmd": false,
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/advancedconfig_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This is the full documentation to customize your `advancedconfig.json`.
| retryFailedComments | true or false | If the bot should retry comments that failed in a comment request. Default: false |
| retryFailedCommentsDelay | Number in ms | Time the bot will wait before retrying the failed comments. Default: 300000 (5 minutes) |
| retryFailedCommentsAttempts | Number | How often the bot should retry a failed comment. Default: 1 |
| commentsIpCooldownPenalty | Number | Time in ms to add to cooldown of bot accounts participating in a comment request which experienced an IP Cooldown error (e.g. HTTP 429). **Disabling is not recommended as it might prolong the cooldown.** Default: 300000 (5 minutes) |
| requestsIpCooldownPenalty | Number | Time in ms to add to cooldown of bot accounts participating in a comment request which experienced an IP Cooldown error (e.g. HTTP 429). **Disabling is not recommended as it might prolong the cooldown.** Default: 300000 (5 minutes) |
| lastQuotesSize | Number | Amount (minus 1) of different quotes that need to be selected in between before a quote can be used again. Default: 5 |
|   | | |
| enableevalcmd | true or false | The eval command allows the botowner to run javascript code from the steam chat. **Warning: This can harm your machine! Leave it to false if you don't know what you are doing!** Default: false |
Expand Down
43 changes: 43 additions & 0 deletions docs/wiki/changelogs/CHANGELOG_v2.15.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [2.15.1](#2.15.1)
- [2.15.2](#2.15.2)
- [2.15.3](#2.15.3)
- [2.15.4](#2.15.4)

 

Expand Down Expand Up @@ -233,3 +234,45 @@ Commit: [df92d84](https://github.com/3urobeat/steam-comment-service-bot/commit/d
- Removed docs directory from file checksum check
- Updated dependencies
- Minor other changes

Commit: [199aa8a](https://github.com/3urobeat/steam-comment-service-bot/commit/199aa8a)

 

<a id="2.15.4"></a>

## **2024-10-13, Version 2.15.4**
**Additions:**
- Log error stack (if available) when creating session fails
- Unified all request (comment, vote, ...) iteration skip handlers into one
- Unified all request (comment, vote, ...) error handlers into one
- This also brings features like aborting request on IP cooldown on all proxies to non comment request types
- The `!failed` command now mentions the type of request in its response
- Added progress log message in `dataProcessing` to accurately reflect if bot is hanging on converting owner and group vanities to IDs

**Fixes:**
- Fixed continuously running "Finished logging in..." animation
- Fixed "Detected inactivity [...]" message not displaying non-populated accounts
- Fixed "Detected inactivity [...]" message printing multiple times per minute
- Fixed login softlock checker not handling inactivity when account is online but not populated
- Fixed "[...] waiting for user object [...] to populate" message spamming output file
- Fixed group issues in dataProcessing & log issues in ready when config prop is missing
- Fixed handleMissingGameLicenses causing webSession to loop when config prop is missing
- Fixed supplying steam-session login data without username/password, leading to cryptic error for users
- The session handler now clarifies which account is missing a password
- Fixed controller interpreting Promise from Updater wrong, leading to a short lived double startup behavior after an update

**Changes:**
- Renamed `commentsIpCooldownPenalty` advancedconfig setting to `requestsIpCooldownPenalty`
- This cooldown now applies to all request types, this rename reflects that change
- Added compatibility feature to transfer customized setting
- The `!failed` command now refers to index as interaction to use more intuitive terms
- Revised a bunch of log messages to improve user experience
- Failing to load a language file does not log a confusing error stack anymore before it gets replaced by `dataIntegrity`
- Softlock Handler log messages now include a timestamp
- Refactored a few parts of the codebase
- Moved expiring tokens job register call to ready event and run it instantly
- Replaced deprecated `--production` flag in npm commands with `--omit=dev`
- Updated dependencies
- Minor other changes

762 changes: 364 additions & 398 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "steam-comment-service-bot",
"version": "2.15.3",
"description": "The most advanced Steam Multi Account Manager with built-in comment, like & favorite commands and extensive plugin support.",
"version": "2.15.4",
"description": "The most advanced Steam Account Manager Bot with mass coordinated comments/likes/favs/follows and plugin support",
"main": "start.js",
"dependencies": {
"@seald-io/nedb": "^4.0.4",
Expand All @@ -15,11 +15,11 @@
"steam-comment-bot-discord-plugin": "^1.0.3",
"steam-comment-bot-rest": "^1.3.0",
"steam-comment-bot-webserver": "^1.0.1",
"steam-session": "^1.7.2",
"steam-user": "^5.0.10",
"steamcommunity": "^3.48.3",
"steam-session": "^1.9.0",
"steam-user": "^5.2.0",
"steamcommunity": "^3.48.4",
"steamid": "^2.1.0",
"steamid-resolver": "^1.3.4"
"steamid-resolver": "^1.3.5"
},
"scripts": {
"start": "node start.js",
Expand All @@ -35,9 +35,9 @@
"homepage": "https://github.com/3urobeat",
"repository": "https://github.com/3urobeat/steam-comment-service-bot",
"devDependencies": {
"@eslint/js": "^9.9.0",
"eslint": "^9.9.0",
"eslint-plugin-jsdoc": "^50.2.0",
"@eslint/js": "^9.12.0",
"eslint": "^9.12.0",
"eslint-plugin-jsdoc": "^50.3.2",
"tsd-jsdoc": "^2.5.0"
},
"types": "./types/types.d.ts"
Expand Down
6 changes: 5 additions & 1 deletion src/bot/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2024-08-12 20:21:19
* Last Modified: 2024-10-12 16:00:32
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
Expand Down Expand Up @@ -69,7 +69,11 @@ const Bot = function(controller, index) {
* Additional login related information for this bot account
*/
this.loginData = {
/**
* @type {{ index: number, accountName: string, password: string, sharedSecret?: string, steamGuardCode?: null, machineName?: string, deviceFriendlyName?: string }}
*/
logOnOptions: controller.data.logininfo.find((e) => e.index == index), // TODO: This could be an issue later when the index could change at runtime

logOnTries: 0,
relogTries: 0, // Amount of times logOns have been retried after relogTimeout. handleRelog() attempts to cycle proxies after enough failures
pendingLogin: false,
Expand Down
4 changes: 2 additions & 2 deletions src/bot/events/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2024-08-10 19:13:29
* Last Modified: 2024-10-12 16:00:32
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
Expand Down Expand Up @@ -73,7 +73,7 @@ Bot.prototype._attachSteamErrorEvent = function() {
// Abort if bot0 failed on initial login or skip account for now
if (this.index == 0 && this.controller.info.readyAfter == 0) {
logger("", "", true);
logger("error", "Aborting because the first bot account always needs to be logged in!\nPlease correct what caused the error and try again.", true);
logger("error", "Aborting because the first bot account always needs to be logged in!\n Please correct what caused the error and try again.", true);
return this.controller.stop();

} else {
Expand Down
8 changes: 4 additions & 4 deletions src/bot/events/webSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2024-03-08 16:21:53
* Last Modified: 2024-10-13 11:57:34
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
Expand Down Expand Up @@ -71,12 +71,12 @@ Bot.prototype._attachSteamWebSessionEvent = function() {

setTimeout(async () => {
if (this.index == 0) this.sendChatMessage(this, { userID: String(thisfriend) }, await this.controller.data.getLang("useradded", { "cmdprefix": "!", "langcount": Object.keys(this.data.lang).length }, String(thisfriend)));
else logger("debug", "Not sending useradded message because this isn't the main user...");
else logger("debug", `[${this.logPrefix}] Not sending useradded message because this isn't the main bot...`);
}, 1000 * processedFriendRequests);


// Add user to lastcomment database
const time = Date.now() - (this.controller.data.config.requestCooldown * 60000); // Subtract requestCooldown so that the user is able to use the command instantly;
const time = Date.now() - ((this.controller.data.config.requestCooldown || 0) * 60000); // Subtract requestCooldown (if !undefined) so that the user is able to use the command instantly;

this.controller.data.lastCommentDB.update({ id: thisfriend }, { $set: { time: time } }, { upsert: true }, (err) => {
if (err) logger("error", "Error inserting new user into lastcomment.db database! Error: " + err);
Expand Down Expand Up @@ -109,7 +109,7 @@ Bot.prototype._attachSteamWebSessionEvent = function() {

// Check if acceptgroupinvites is set to false and only allow botsgroup invite to be accepted
if (!this.controller.data.config.acceptgroupinvites) {
if (this.controller.data.config.yourgroup.length < 1 && this.controller.data.config.botsgroup.length < 1) return;
if (!this.controller.data.config.yourgroup && !this.controller.data.config.botsgroup) return;
if (thisgroup != this.controller.data.cachefile.configgroup64id && thisgroup != this.controller.data.cachefile.botsgroupid) return;
logger("info", "acceptgroupinvites is turned off but this is an invite to the group set as yourgroup or botsgroup. Accepting invite anyway...");
}
Expand Down
15 changes: 8 additions & 7 deletions src/bot/helpers/handleMissingGameLicenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2023-06-29 21:31:53
* Author: 3urobeat
*
* Last Modified: 2024-08-10 19:13:29
* Last Modified: 2024-10-12 12:36:10
* Modified By: 3urobeat
*
* Copyright (c) 2023 - 2024 3urobeat <https://github.com/3urobeat>
Expand All @@ -24,23 +24,24 @@ const Bot = require("../bot.js");
Bot.prototype.handleMissingGameLicenses = function() {
const data = this.controller.data;

// Check if user provided games specifically for this account. We only need to check this for child accounts
let configChildGames = data.config.childaccplayinggames;
const configMainGames = data.config.playinggames || [];
let configChildGames = data.config.childaccplayinggames || [];

if (typeof configChildGames[0] == "object" && configChildGames[0] != null) { // - typeof null == "object"
// Check if user provided games specifically for this account. We only need to check this for child accounts
if (configChildGames && typeof configChildGames[0] == "object" && configChildGames[0] != null) { // - typeof null == "object"
if (Object.keys(configChildGames[0]).includes(this.accountName)) configChildGames = configChildGames[0][this.accountName]; // Get the specific settings for this account if included
else configChildGames = configChildGames.slice(1); // ...otherwise remove object containing acc specific settings to use the generic ones
else configChildGames = configChildGames.slice(1); // ...otherwise remove object containing acc specific settings to use the generic ones

logger("debug", `[${this.logPrefix}] Bot handleMissingGameLicenses(): Setting includes specific games, filtered for this account: ${configChildGames.join(", ")}`);
}


// Shorthander for starting to play
const startPlaying = () => { if (this.index == 0) this.user.gamesPlayed(this.controller.data.config.playinggames); else this.user.gamesPlayed(configChildGames); };


const options = {
includePlayedFreeGames: true,
filterAppids: this.index == 0 ? data.config.playinggames.filter(e => !isNaN(e)) : configChildGames.filter(e => !isNaN(e) && e != null), // We only need to check for these appIDs. Filter custom game string and null values
filterAppids: this.index == 0 ? configMainGames.filter(e => !isNaN(e)) : configChildGames.filter(e => !isNaN(e) && e != null), // We only need to check for these appIDs. Filter custom game string and null values
includeFreeSub: false
};

Expand Down
13 changes: 7 additions & 6 deletions src/commands/core/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2021-07-09 16:26:00
* Author: 3urobeat
*
* Last Modified: 2024-08-10 22:44:28
* Last Modified: 2024-10-10 18:24:16
* Modified By: 3urobeat
*
* Copyright (c) 2021 - 2024 3urobeat <https://github.com/3urobeat>
Expand All @@ -16,10 +16,11 @@


const CommandHandler = require("../commandHandler.js"); // eslint-disable-line
const { getCommentArgs } = require("../helpers/getCommentArgs.js");
const { getAvailableBotsForCommenting } = require("../helpers/getCommentBots.js");
const { syncLoop, timeToString } = require("../../controller/helpers/misc.js");
const { logCommentError, handleIterationSkip } = require("../helpers/handleCommentSkips.js");
const { getCommentArgs } = require("../helpers/getCommentArgs.js");
const { getAvailableBotsForCommenting } = require("../helpers/getCommentBots.js");
const { syncLoop, timeToString } = require("../../controller/helpers/misc.js");
const { logRequestError } = require("../helpers/handleRequestErrors.js");
const { handleIterationSkip } = require("../helpers/handleRequestSkips.js");


module.exports.comment = {
Expand Down Expand Up @@ -301,7 +302,7 @@ async function comment(commandHandler, resInfo, respond, postComment, commentArg

/* --------- Handle errors thrown by this comment attempt or log success message --------- */
if (error) {
logCommentError(error, commandHandler, bot, receiverSteamID64);
logRequestError(error, commandHandler, bot, receiverSteamID64);
} else {
if (commandHandler.data.proxies.length > 1) logger("info", `[${bot.logPrefix}] Comment ${activeReqEntry.thisIteration + 1}/${activeReqEntry.amount} ${whereStr} with proxy ${bot.loginData.proxyIndex}: ${String(quote).split("\n")[0]}`);
else logger("info", `[${bot.logPrefix}] Comment ${activeReqEntry.thisIteration + 1}/${activeReqEntry.amount} ${whereStr}: ${String(quote).split("\n")[0]}`); // Splitting \n to only get first line of multi line comments
Expand Down
13 changes: 7 additions & 6 deletions src/commands/core/favorite.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2023-06-02 13:23:01
* Author: 3urobeat
*
* Last Modified: 2024-03-08 19:20:53
* Last Modified: 2024-10-10 18:19:35
* Modified By: 3urobeat
*
* Copyright (c) 2023 - 2024 3urobeat <https://github.com/3urobeat>
Expand All @@ -19,7 +19,8 @@ const CommandHandler = require("../commandHandler.js"); // eslint-disable-line
const { getMiscArgs } = require("../helpers/getMiscArgs.js");
const { getAvailableBotsForFavorizing } = require("../helpers/getFavoriteBots.js");
const { syncLoop, timeToString } = require("../../controller/helpers/misc.js");
const { handleFavoriteIterationSkip, logFavoriteError } = require("../helpers/handleMiscErrors.js");
const { logRequestError } = require("../helpers/handleRequestErrors.js");
const { handleIterationSkip } = require("../helpers/handleRequestSkips.js");


module.exports.favorite = {
Expand Down Expand Up @@ -154,7 +155,7 @@ module.exports.favorite = {
const bot = commandHandler.controller.bots[availableAccounts[i]];
activeReqEntry.thisIteration++;

if (!handleFavoriteIterationSkip(commandHandler, loop, bot, id)) return; // Skip iteration if false was returned
if (!handleIterationSkip(commandHandler, loop, bot, id)) return; // Skip iteration if false was returned

let favFunc = bot.community.favoriteSharedFile;

Expand All @@ -169,7 +170,7 @@ module.exports.favorite = {

/* --------- Handle errors thrown by this favorite attempt or update ratingHistory db and log success message --------- */
if (error) {
logFavoriteError(error, commandHandler, bot, id);
logRequestError(error, commandHandler, bot, id);

} else {

Expand Down Expand Up @@ -352,7 +353,7 @@ module.exports.unfavorite = {
const bot = commandHandler.controller.bots[availableAccounts[i]];
activeReqEntry.thisIteration++;

if (!handleFavoriteIterationSkip(commandHandler, loop, bot, id)) return; // Skip iteration if false was returned
if (!handleIterationSkip(commandHandler, loop, bot, id)) return; // Skip iteration if false was returned

let favFunc = bot.community.unfavoriteSharedFile;

Expand All @@ -367,7 +368,7 @@ module.exports.unfavorite = {

/* --------- Handle errors thrown by this unfavorite attempt or update ratingHistory db and log success message --------- */
if (error) {
logFavoriteError(error, commandHandler, bot, id);
logRequestError(error, commandHandler, bot, id);

} else {

Expand Down
Loading

0 comments on commit 57a0338

Please sign in to comment.