Skip to content

Commit

Permalink
Version 2.15.2
Browse files Browse the repository at this point in the history
Merge pull request #245
  • Loading branch information
3urobeat authored May 9, 2024
2 parents a8a04eb + 5e148f6 commit df92d84
Show file tree
Hide file tree
Showing 100 changed files with 1,420 additions and 1,107 deletions.
67 changes: 0 additions & 67 deletions .eslintrc.json

This file was deleted.

12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Report an error/a problem you experienced
name: Bug Report
about: Report an error or problem you've experienced
title: ''
labels: Bug
assignees: ''

---

**Describe the bug**
**Please describe the bug**
What happened?

**Full error**
Please post the **complete** error here!
**Full error stack trace**
If you've got an error, please post the **entire** error stack trace here!

**Additional context**
Please add any other information here if you have some.
Please add any other information here, if you have some.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Feature request
name: Feature Request
about: Suggest a feature idea
title: ''
labels: Enhancement
Expand All @@ -11,4 +11,4 @@ assignees: ''
A clear description of what should happen.

**Additional context**
Add any other context or screenshots about the feature request here.
Please add any other information here, if you have some.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/help-wanted-question.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Help wanted/Question
name: I need help
about: I have a question/need help but a Q&A discussion isn't fitting
title: ''
labels: Question
Expand All @@ -11,4 +11,4 @@ assignees: ''
Please explain your question here. If you've got an error or something else related, then please include it here as well.

**Additional information**
Please add any other information here if you have some.
Please add any other information here, if you have some.
1 change: 1 addition & 0 deletions advancedconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"relogTimeout": 900000,
"maxLogOnRetries": 1,
"useLocalIP": true,
"enableRelogOnLogOnSessionReplaced": true,
"dummy1": "------------------- General Settings: -------------------",
"acceptFriendRequests": true,
"forceFriendlistSpaceTime": 4,
Expand Down
7 changes: 7 additions & 0 deletions docs/dev/controller/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ The event is emitted with the parameters
The `submitCode` function allows users to implement accepting Steam Guard Codes from users into their plugins. This is very cool.
Check out how the [template plugin](https://github.com/3urobeat/steam-comment-bot-template-plugin/blob/main/plugin.js) implements the
`steamGuardInput` event function (which is called by the PluginSystem when the event is emitted, instead of listening directly to it).

## steamGuardQrCode <a href="/src/controller/events/steamGuardQrCode.js" target="_blank"><img align="right" src="https://img.shields.io/badge/<%2F>%20Source-darkcyan"></a>
This event is emitted when any bot account is trying to log in using a QR-Code. A user needs to scan this QR-Code using their Steam Mobile App to confirm the login request.

The event is emitted with the parameters
- `bot` ([Bot](../bot/bot.md)) - Bot instance of the affected account
- `challengeUrl` (string) - The QrCode Challenge URL supplied by Steam. Display this value using a QR-Code parser and let a user scan it using their Steam Mobile App.
1 change: 1 addition & 0 deletions docs/wiki/advancedconfig_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This is the full documentation to customize your `advancedconfig.json`.
| relogTimeout | Number in ms | Time the bot will wait after failing all reconnect attempts before trying again. Default: 900000 (15 minutes) |
| maxLogOnRetries | Number | Amount of times the bot will retry logging in to an account if the first try fails. Default: 1 |
| useLocalIP | true or false | If the bot should use your real IP as well when using proxies. Default: true |
| enableRelogOnLogOnSessionReplaced | true or false | If the bot should relog accounts when they loose connection with the error message 'LogOnSessionReplaced'. This error is usually caused when someone logs into an account from somewhere else. Default: true |
| &nbsp; | | |
| acceptFriendRequests | true or false | If the bot should accept friend requests. Default: true |
| forceFriendlistSpaceTime | Number in days | Amount of days a user hasn't requested something to get unfriended if only one friend slot is left. Set to 0 to disable. Default: 4 |
Expand Down
38 changes: 38 additions & 0 deletions docs/wiki/changelogs/CHANGELOG_v2.15.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
**Current**
- [2.15.0](#2.15.0)
- [2.15.1](#2.15.1)
- [2.15.2](#2.15.2)

&nbsp;

Expand Down Expand Up @@ -158,3 +159,40 @@ Commit: [be41d68](https://github.com/3urobeat/steam-comment-service-bot/commit/b
- Reduced chances of startup ascii art showing an easter egg ascii art
- Updated dependencies
- Minor other changes

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

&nbsp;

<a id="2.15.2"></a>

## **2024-05-09, Version 2.15.2**
**Additions:**
- Added traditional chinese translation [@Tira-tw](https://github.com/Tira-tw) in [#242](https://github.com/3urobeat/steam-comment-service-bot/pull/242)
- Added !add alias to !addfriend command
- Added steamGuardQrCode event to enable plugins to resolve Steam Guard QR-Code requests
- Added more login related log messages to default log level
- Added more login related debug log messages to improve ability to debug login process resolving issues
- Added (experimental) force-resolve feature to login process when inactivity is detected
- Added setting 'enableRelogOnLogOnSessionReplaced' to `advancedconfig.json` to control whether the bot should relog accounts that have lost their connection with the error 'LogOnSessionReplaced'. Default value is `true`. To retain the same behavior as previously, where the bot would skip those accounts, set the value to `false`.

**Fixes:**
- Fixed login starting faster than plugin load, making it unable for them to handle steamGuardCode events
- Fixed proxy switcher not switching to proxy 0
- Fixed default quotes file containing a political entry
- (Potentially) finally fixed 'Already logged on, cannot log on again' errors when relogging for good
- Fixed potential login softlock when account switches proxy while a login process is active, with that account queued in it
- Fixed wrong syntax of variable in language string 'addfriendcmdsuccess'
- Fixed 'userunfriend' & 'userforceunfriend' language strings being flipped internally

**Changes:**
- The bot will now always emit the ready event on the second login rerun even if POSTPONED accounts still exist
- Refactored some code to use the proper log prefix more consistently instead of sometimes switching to bot index
- Refactored some code to surround userIDs more consistently with quotation marks
- Refactored some code to simplify the unfriendall command
- Improved contributing page
- Improved issue templates
- Migrated eslint config for eslint v9 and added & enforced two more rules
- Updated hostname check
- Updated dependencies
- Minor other changes
31 changes: 19 additions & 12 deletions docs/wiki/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Please read this page *before* diving in, it contains a few **very** important p
## Table Of Contents
- [Reporting an issue](#reporting-an-issue)
- [How to fork and open pull requests](#how-to-fork-and-open-pull-requests)
- [Translating](#translating)
- [Styling Guidelines](#styling-guidelines)
- [Updating or Adding a language translation](#translating)
- [Styling guidelines](#styling-guidelines)
- [Starting the bot](#starting-the-bot)

&nbsp;

## Reporting an Issue
Found a bug?
Please report it by creating an [issue](https://github.com/3urobeat/steam-comment-service-bot/issues/new/choose) so that I am able to fix it!
If you've got a feature request instead, you can choose the "Feature request" template instead.
Found a bug/error?
Please report it by creating an [issue](https://github.com/3urobeat/steam-comment-service-bot/issues/new/choose). I'll respond as soon as possible.
If you've got a feature request instead, you can choose the "Feature request" template.

If you have any questions, please open a [Q&A discussion](https://github.com/3urobeat/steam-comment-service-bot/discussions/new?category=q-a) instead!

Expand All @@ -35,29 +35,37 @@ To contribute code to the project, you first need to fork this repository. Go to
Before clicking the "Create fork" button in the next menu, make sure the checkmark at "Copy the `master` branch only" is **unchecked**!
After waiting a few seconds you should now have a *copy* of the repository on your account.

Go into a folder on your computer where the project should be stored, open a terminal and run the command
`git clone https://github.com/your-username/steam-comment-service-bot` or use any other Git Client of your choice.
Assuming you already have `git` installed on your computer, open a folder on your PC where the project should be stored.
Open a terminal in this location and run the command
`git clone https://github.com/your-username/steam-comment-service-bot`
...or use any other Git Client of your choice.

Once the repository has been cloned, switch to the `beta-testing` branch using the command `git checkout beta-testing`.
This branch contains the latest changes and must be the one you base your changes off of. The `master` branch contains the latest release.

You can now create your own branch using `git checkout -b "branchname"`, make changes and commit them to it.
It makes sense to give the branch a sensible name based on what your changes will be, but no pressure.

The setup of your dev bot is very similar to the [normal setup](./setup_guide.md), however make sure to run `npm install` manually. This will install all dev dependencies, which are omitted in the normal installation.
The setup of your dev bot is very similar to the [normal setup](./setup_guide.md), however make sure to run the command `npm install` in your terminal manually.
This will install all dev dependencies, which are omitted in the normal installation to save space.
It is probably also a good idea to enable `printDebug` in `advancedconfig.json` to see a more detailed log output.

Once you have made your changes and verified they are working as expected, you need to open a Pull Request to merge them into this repository.
Make sure you have read '[Starting the bot](#starting-the-bot)' at the bottom of the page, before starting the bot to test your changes.

Once you have made your changes and verified they are working as expected, you need to open a Pull Request to get them merged into this repository.
[Click here](https://github.com/3urobeat/steam-comment-service-bot/compare/), click on "Compare across forks" at the top and select `base: beta-testing` on the left side.
Then, choose your fork on the right at `head repository:`, your branch at `compare:` and click on "Create Pull Request".

Give your pull request a fitting title which describes your changes in a few words and put a more in depth explanation below in the description.
Once you are satisfied, hit the "Create pull request" button below to submit.
I'll take a look at it and perhaps suggest or make some minor changes in the following few days.
Once everything looks good, I will merge your changes and they will be included in the next version.

&nbsp;

## Translating
The bot includes more translations than languages I speak myself - so I need your help here!

**Updating an existing language:**
I'm changing or adding new messages nearly every update, so there are often language strings that need to be updated.
It'd be great if you could help!
Expand Down Expand Up @@ -122,9 +130,8 @@ In short, the main styling rules are:
&nbsp;

## Starting the bot
When starting the bot during development, it is crucial to execute the [generateFileStructure](/scripts/generateFileStructure.js) script before starting the bot, on every change.
You can do this easily by using a simple chained command:
`node scripts/generateFileStructure.js && node start.js`
When starting the bot during development, it is crucial to update every file's checksum, on every change.
You can do this easily by starting the bot using the command: `npm run dev`

This ensures that [fileStructure.json](/src/data/fileStructure.json), which contains checksums for every file, gets updated.
The application will otherwise recognize your changed file as broken and will restore it with the default one.
Expand Down
14 changes: 10 additions & 4 deletions docs/wiki/creating_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,18 @@ It makes sense to load your plugin config file from your plugin config folder, j
We are also registering a super cool command here with the names '!hello' and '!cool-alias'. If someone executes it, it will respond with 'Hello World!'. Registering commands and responding to the user is further explained below.

**Event functions:**
The template plugin also exposes a 'ready', 'statusUpdate', 'steamGuardInput' function.
The template plugin also exposes a 'ready', 'statusUpdate', 'steamGuardInput', 'steamGuardQrCode' function.
These are functions that will be called by the plugin system when the bot emits those events.

The ready event function is called when the bot has finished logging in all accounts. Should the plugin load be caused by '!reload', this function is executed milliseconds after `load()` has been called.
The statusUpdate event function is called when any bot account changes their status. Every status a bot can have is documented in the [EStatus enum](../../src/bot/EStatus.js).
The steamGuardInput event function is called when any bot account is currently being logged in, but a Steam Guard Code is requested. The bot has a built in handler that will request code input from the terminal on this event.
The 'ready' event function is called when the bot has finished logging in all accounts. Should the plugin load be caused by '!reload', this function is executed milliseconds after `load()` has been called.

The 'statusUpdate' event function is called when any bot account changes their status. Every status a bot can have is documented in the [EStatus enum](../../src/bot/EStatus.js).

The 'steamGuardInput' event function is called when any bot account is currently being logged in and a Steam Guard Code was requested by Steam.
The bot has a built in handler that will request code input from the terminal on this event. Plugins can use the `code()` callback function in `steamGuardInput(bot, code)` to supply a code themselves, resolving the request as well.
If a session was started by logging in using a QrCode instead of a password, the event 'steamGuardQrCode' will be fired instead. Plugins can display the QrCode supplied in this event, for example using the [qrcode library](https://www.npmjs.com/package/qrcode), which will resolve the request once it has been scanned using a Steam Mobile App.

To check from your plugin if the Steam Guard Code/QrCode request has been resolved, wait for the statusUpdate event to announce a change.

&nbsp;

Expand Down
Loading

0 comments on commit df92d84

Please sign in to comment.