Skip to content

Commit

Permalink
docs: Add entries for new steamGuardQrCode event
Browse files Browse the repository at this point in the history
  • Loading branch information
3urobeat committed May 1, 2024
1 parent fdd1e5d commit fdd0f14
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
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.
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
4 changes: 2 additions & 2 deletions src/data/fileStructure.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
{
"path": "docs/dev/controller/events.md",
"url": "https://raw.githubusercontent.com/3urobeat/steam-comment-service-bot/beta-testing/docs/dev/controller/events.md",
"checksum": "cab6f4fe3d8b9fa0374bf9aaa33c965d"
"checksum": "8c1a3cfb9b911e2fc61c77ae4251db38"
},
{
"path": "docs/dev/controller/helpers.md",
Expand Down Expand Up @@ -248,7 +248,7 @@
{
"path": "docs/wiki/creating_plugins.md",
"url": "https://raw.githubusercontent.com/3urobeat/steam-comment-service-bot/beta-testing/docs/wiki/creating_plugins.md",
"checksum": "11ea6f29f4c9591b6a00c637e4ab928b"
"checksum": "11b8d3b398f638581f260ff5cf64d95c"
},
{
"path": "docs/wiki/customlang_doc.md",
Expand Down

0 comments on commit fdd0f14

Please sign in to comment.