diff --git a/docs/dev/controller/events.md b/docs/dev/controller/events.md index 2d8d697e..f60c9fc3 100644 --- a/docs/dev/controller/events.md +++ b/docs/dev/controller/events.md @@ -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 +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. diff --git a/docs/wiki/creating_plugins.md b/docs/wiki/creating_plugins.md index 6461140c..7174e7fb 100644 --- a/docs/wiki/creating_plugins.md +++ b/docs/wiki/creating_plugins.md @@ -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.   diff --git a/src/data/fileStructure.json b/src/data/fileStructure.json index ca60a531..face43c2 100644 --- a/src/data/fileStructure.json +++ b/src/data/fileStructure.json @@ -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", @@ -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",