Skip to content

Commit

Permalink
Merge pull request #118 from HerrEurobeat/beta-testing
Browse files Browse the repository at this point in the history
Version 2.11.1
  • Loading branch information
3urobeat authored Oct 22, 2021
2 parents a53fc2e + 7fbac97 commit 54bd90b
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 55 deletions.
69 changes: 27 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"express": "^4.17.1",
"htmlparser2": "^4.1.0",
"https": "^1.0.0",
"output-logger": "^1.3.3",
"output-logger": "^1.3.4",
"request": "^2.88.2",
"steam-user": "^4.19.12",
"steamcommunity": "^3.43.1",
Expand Down
14 changes: 11 additions & 3 deletions src/bot/commands/comment/cmisc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 09.07.2021 16:26:00
* Author: 3urobeat
*
* Last Modified: 15.10.2021 22:23:55
* Last Modified: 22.10.2021 19:21:00
* Modified By: 3urobeat
*
* Copyright (c) 2021 3urobeat <https://github.com/HerrEurobeat>
Expand All @@ -27,7 +27,11 @@
module.exports.abort = (chatmsg, steamID, lang, args, steam64id) => {
var mainfile = require("../../main.js")

if (args[0]) steam64id = args[0] //if user provided an id as argument then use that instead of his/her id
if (args[0]) {
if (!config.ownerid.includes(steam64id)) return chatmsg(steamID, lang.commandowneronly)

steam64id = args[0] //if user provided an id as argument then use that instead of his/her id
}

if (!mainfile.activecommentprocess[steam64id] || mainfile.activecommentprocess[steam64id].status != "active") return chatmsg(steamID, lang.abortcmdnoprocess)

Expand Down Expand Up @@ -91,7 +95,11 @@ module.exports.failed = (chatmsg, steamID, lang, args, steam64id) => {
var mainfile = require("../../main.js")
var controller = require("../../../controller/controller.js")

if (args[0]) steam64id = args[0] //if user provided an id as argument then use that instead of his/her id
if (args[0]) {
if (!config.ownerid.includes(steam64id)) return chatmsg(steamID, lang.commandowneronly)

steam64id = args[0] //if user provided an id as argument then use that instead of his/her id
}

controller.lastcomment.findOne({ id: steam64id }, (err, doc) => {
if (!mainfile.failedcomments[steam64id] || Object.keys(mainfile.failedcomments[steam64id]).length < 1) return chatmsg(steamID, lang.failedcmdnothingfound);
Expand Down
8 changes: 4 additions & 4 deletions src/bot/commands/comment/groupcomment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 09.07.2021 16:26:00
* Author: 3urobeat
*
* Last Modified: 17.10.2021 18:14:10
* Last Modified: 22.10.2021 19:04:53
* Modified By: 3urobeat
*
* Copyright (c) 2021 3urobeat <https://github.com/HerrEurobeat>
Expand Down Expand Up @@ -303,10 +303,10 @@ module.exports.run = (chatmsg, steamID, args, res, lastcommentdoc) => {

//Send finished message from here if this is the last iteration and it is on a failed proxy
if (i == numberofcomments - 1) {
if (!res) respondmethod(200, `${lang.commentsuccess2.replace("failedamount", Object.keys(mainfile.failedcomments[recieverSteamID]).length).replace("numberofcomments", numberofcomments)}\n\nTo get detailed information why which comment failed please type '!failed'. You can read why your error was probably caused here: https://github.com/HerrEurobeat/steam-comment-service-bot/wiki/Errors,-FAQ-&-Common-problems`); //only send if not a webrequest
if (!res) respondmethod(200, `${lang.commentsuccess2.replace("failedamount", Object.keys(mainfile.failedcomments[groupid]).length).replace("numberofcomments", numberofcomments)}\n\nTo get detailed information why which comment failed please type '!failed'. You can read why your error was probably caused here: https://github.com/HerrEurobeat/steam-comment-service-bot/wiki/Errors,-FAQ-&-Common-problems`); //only send if not a webrequest

mainfile.activecommentprocess[recieverSteamID].status = "cooldown"
mainfile.commentcounter += numberofcomments - Object.keys(mainfile.failedcomments[recieverSteamID]).length //add numberofcomments minus failedamount to commentcounter
mainfile.activecommentprocess[groupid].status = "cooldown"
mainfile.commentcounter += numberofcomments - Object.keys(mainfile.failedcomments[groupid]).length //add numberofcomments minus failedamount to commentcounter
}

return; //stop further execution
Expand Down
3 changes: 2 additions & 1 deletion src/bot/events/friendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 09.07.2021 16:26:00
* Author: 3urobeat
*
* Last Modified: 15.10.2021 22:18:55
* Last Modified: 22.10.2021 19:04:03
* Modified By: 3urobeat
*
* Copyright (c) 2021 3urobeat <https://github.com/HerrEurobeat>
Expand Down Expand Up @@ -130,6 +130,7 @@ module.exports.run = (loginindex, thisbot, bot, community, steamID, message) =>

case '!gcomment':
case '!groupcomment':
if (!ownercheck) return notownerresponse();
if (disablecommentcmd) return chatmsg(steamID, lang.botmaintenance)
if (!ready.readyafter || controller.relogQueue.length > 0) return chatmsg(steamID, lang.botnotready) //Check if bot is not fully started yet and block cmd usage to prevent errors

Expand Down
2 changes: 1 addition & 1 deletion src/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "21100",
"versionstr": "2.11",
"filetostart": "./src/starter.js",
"filetostarturl": "https://raw.githubusercontent.com/HerrEurobeat/steam-comment-service-bot/master/src/starter.js",
"filetostarturl": "https://raw.githubusercontent.com/HerrEurobeat/steam-comment-service-bot/beta-testing/src/starter.js",
"botobjectfile": "./src/controller/controller.js"
}
6 changes: 3 additions & 3 deletions src/data/data.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"version": "21100",
"versionstr": "2.11.0",
"version": "21101",
"versionstr": "2.11.1",
"branch": "master",
"filetostart": "./src/starter.js",
"filetostarturl": "https://raw.githubusercontent.com/HerrEurobeat/steam-comment-service-bot/master/src/starter.js",
"mestr": "3urobeat",
"aboutstr": "This bot was created by 3urobeat.\nGitHub: https://github.com/HerrEurobeat/steam-comment-service-bot \nSteam: https://steamcommunity.com/id/3urobeat \nIf you like my work, any donation would be appreciated! https://paypal.me/3urobeat",
"firststart": true,
"compatibilityfeaturedone": false,
"whatsnew": "Rewritten the majority of the bot. Added !groupcomment, !sessions and !mysessions cmds. Improved logging, proxy support, error handling and a lot more. Read commit description on GitHub for more details. Minimum node.js version is now v14.15.0!",
"whatsnew": "Fixed log spam issues with animations. Fixed security vulnerability in !abort and !failed command.",
"urlrequestsecretkey": "",
"timesloggedin": 0,
"totallogintime": 0
Expand Down

0 comments on commit 54bd90b

Please sign in to comment.