Merge branch 'main' of codeberg.org:Bingus_Violet/SteamRPC

This commit is contained in:
Bingus_Violet 2024-01-04 17:33:58 -06:00
commit bc05e8b3a9
2 changed files with 20 additions and 10 deletions

View file

@ -19,10 +19,12 @@ git clone https://codeberg.org/Bingus_Violet/SteamRPC
cd SteamRPC
```
In order for SteamRPC to run, you need to give it 2 environment variables. <br> Example:
In order for SteamRPC to run, you need to provide it with a Steam ID. There are 2 ways to do this, the first is through environment variables.
<br> Example:
```bash
STEAM_ID=12345678 node index.js
```
Alternatively, running SteamRPC without providing an ID through an environment variable will make it prompt you for one.
Below you can find documentation for how to get your Steam ID.
@ -45,26 +47,34 @@ node index.js
```
There are also option environment variables:
Here is a concise list of all 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!:<br>
![Alt text](docs/examples/image.png)<br>
![Alt text](docs/examples/image-1.png)<br>
![Alt text](docs/examples/image-2.png)<br>
![Alt text](docs/examples/image-3.png)<br>
![Alt text](docs/examples/image.png)
![Alt text](docs/examples/image-1.png)
![Alt text](docs/examples/image-2.png)
![Alt text](docs/examples/image-3.png)
## Notes
This project was never meant to be public, but I decided there was no reason not to. Please do report any problems you encounter, and if there are any issues with the documentation, please let me know!
If an image is wider than 1:1, then discord automatically "zooms in" on the image. Sadly, the only high quality image for the game we can get from Steam is very wide, specifically its the title icon. To fix this, all images are funneled through "thumbor"
Currently I am using a self hosted instance of Thumbor for this, which automatically changes the image size so it fits in Discord.
The link to the Thumbor instance can be found here:
https://thumbor-production-0e82.up.railway.app/
For getting the right image size, we use this url configuration:
`https://thumbor-production-0e82.up.railway.app/unsafe/fit-in/512x512/filters:fill(transparent)/[Link to the image]`
## To-Do
- [x] Pull images from steam directly
- [x] Show profile picture and username as small Image
- [x] Hide when not playing a game
- [ ] Allow Steam Icon Overrides
- [ ] Add config
- [ ] Allow more configurable options
- [ ] Add blacklist for certain games that have their own RPC
- [ ] Add config

View file

@ -1,7 +1,7 @@
const fs = require('fs'),
prompt = require("prompt-sync")()
var updateTime = (process.env.UPDATE_TIME || 45)
var updateTime = 45
var clientId = "1176317740512985119"
@ -9,7 +9,7 @@ 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):background_color(rgb(50,%2050,%2050))/"
if (updateTime < 30) {
if (updateTime < 30) { // Please, refrain from changing this! This program is already effectively DDoSing valve servers, I dont want it to go any further!
console.error("Update time must be above 30! Please change your settings!")
return
}