This bot allows you to watch Steam game news. My friend Damn3d had the idea.
Do check out Steam Watch by DukeOfSussex as well.
- 🇫🇷 French: Morgân von Brylân
- 🇩🇪 German: jemand2001
- 🇷🇺 Russian: B1ngell
- 🇵🇱 Polish : jakubex
- 🇪🇸 Spanish: ajuanjojjj
This bot requires Node.JS 16 or higher.
You will need an auth.json file in the same folder as bot.js widht the following data:
{
"token": "your bot's authentication token",
"master": "your user id",
"adminServer": "the id of the server where the admin commands will be available, for you",
"baseWatcherLimit": 25,
"steamGridDB": "Your SteamGridDB token here, for fetching icons",
"webhookPort": 5050,
"topGG": {
"token": "(optional) your bot's Top.gg token",
"webhook": {
"endpoint": "/topggVote",
"secret": "whs_abc123"
},
"voteWatcherBonus": 25
},
"dbl": {
"token": "(optional) your bot's discordbotlist token",
"webhook": {
"endpoint": "/dblVote",
"secret": "super-secret-thing"
}
},
"debug": false,
"logLevel": "warn",
"backups": false,
"supportServer": "(optional) The invite to your support server",
"premium": {
"bonus": 250,
"moreWatchers": "the 'more watchers' SKU id",
"rebrand": "the 'rebrand' SKU id",
"chameleon": "the 'chameleon' SKU id",
"gold": "the 'gold plan' SKU id",
"freeGoldPlans": {},
"freeWatchers": {}
},
"donate": "(optional) The URL for donations"
}debug should be true in development and false (or not set) in production. In debug mode, commands are created as server commands for quicker updating. They are global commands otherwise. Also, commands under the debug subfolder are ignored unless in debug mode.
Additionally, debug can be a list of entitlements to immediately enable in the test server for the current bot session, for example ["Watchers", "Chameleon"]. See commands/~debug/add-entitlements.js
The logLevel can be "silent", "error", "warn", "log" or "verbose". If not set, defaults to "warn". Note: if debug is true, the log level is forcefully set to "verbose".
backups assigns the backup schedule. Possible values are false, "daily" and "weekly". Backups are done at midnight, on Sundays if weekly. If omitted or null, defaults to "weekly". If the BACKUP_SCHEDULE environment variable is set, it will have priority over the auth.json value.
The premium category is optional.
freeGoldPlans must be either an array of server ids or an object whose values are server ids. The object option is so you can label those ids. freeWatchers works the same.
To start the bot, run node bot.js
Both topGG and dbl are optional.
To update the bot's stats on Top.gg, set its API token. Same with Discord Bot List (DBL). For Top.gg, you need to use a v2 token, and do include the Bearer prefix. Make sure the token has write permissions.
If the webhookPort is not specified, the SERVER_PORT environment variable will be used instead. If any endpoint is not specified, the value shown in the example will be used.
You can customize which errors are ignored or truncated by created a errors.json file.
errors.json is a JSON file that can have the following keys:
ignorefor rules for ignoring some errorstruncateto only log the error message and not thedowngradeto log the error as a warning, meaning it could be ignored if the log level is low enough.
Note that an error can be both truncated and downgraded if it matches a rule of both.
The values for these properties is an object that can have the following keys:
messageto test the error messagestatusto test HTTP status codescodeto test Node.JS error codes
The values for these properties are either rules or arrays of rules. A rule is a value to check against. By default, it tests for equality, but you can add a prefix to make other checks:
^to check if it starts with the substring*to check if it contains the substring$to check if it ends with the substring<,≤,>,≥: check if the value is lesser/greater/or equal
If you want to check for equality with those symbols at the beginning, you can escape the prefix with a backslash.
Example: ignore server errors, connection errors and timeouts, truncate "forbidden" errors, truncate and downgrade "not found" errors, downgrade all fetch errors (they start with "UND_" because Node uses Undici)
{
"ignore": {
"status": ["≥500", 408],
"message": "read ECONNRESET"
},
"truncate": {
"status": [403, 404]
},
"downgrade": {
"status": 404,
"code": "^UND_"
}
}See the const settings = ... part in utils/error.js to see the default behavior.
Just read steam_news/db.js, there is a bunch of CREATE TABLE at the beginning.
I accept pull requests.
You can also make donations on LiberaPay.
Steam News is published under GNU General Public Licence v3 (GPL-3.0). See COPYING.txt
