diff --git a/README.md b/README.md index 6c18ff2..62ddb86 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,15 @@ Although this isn't nessacarily the most sophisticated method for getting your s ### Running it Lastly, all you need to do, is open a terminal and run ``` -STEAM_ID=[your steam id] node index.js +node index.js ``` + There are also option environment variables: - `UPDATE_TIME=[number of seconds to update]` - **this HAS TO BE over 30 seconds** +- `STEAM_ID=[your_steam_id]` + - Prevents the program from prompting you for your steam ID If everything is setup properly, it should look something like this!:
![Alt text](docs/examples/image.png)
diff --git a/index.js b/index.js index 2f916f1..517d88a 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,11 @@ -const fs = require('fs') +const fs = require('fs'), +prompt = require("prompt-sync")() var updateTime = (process.env.UPDATE_TIME || 45) var clientId = "1176317740512985119" -const steamID = process.env.STEAM_ID +const steamID = process.env.STEAM_ID || prompt("What is your Steam ID?: ") const thumborURL = "https://thumbor-production-0e82.up.railway.app/unsafe/fit-in/512x512/filters:fill(transparent)/" diff --git a/package-lock.json b/package-lock.json index f46ea03..47a2053 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,16 @@ "version": "1.0.0", "license": "GPL-3.0-or-later", "dependencies": { - "discord-rpc": "^4.0.1" + "discord-rpc": "^4.0.1", + "prompt-sync": "^4.2.0" + } + }, + "node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "engines": { + "node": ">=6" } }, "node_modules/bindings": { @@ -64,6 +73,14 @@ } } }, + "node_modules/prompt-sync": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz", + "integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==", + "dependencies": { + "strip-ansi": "^5.0.0" + } + }, "node_modules/register-scheme": { "version": "0.0.2", "resolved": "git+ssh://git@github.com/devsnek/node-register-scheme.git#e7cc9a63a1f512565da44cb57316d9fb10750e17", @@ -75,6 +92,17 @@ "node-addon-api": "^1.3.0" } }, + "node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", diff --git a/package.json b/package.json index 737824b..b77dc58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "dependencies": { - "discord-rpc": "^4.0.1" + "discord-rpc": "^4.0.1", + "prompt-sync": "^4.2.0" }, "name": "steamrpc", "description": "SteamRPC pulls your game and presence from Steam and puts it onto discord.",