Add updateNotificationsForBetaVersions option
parent
f46d719f4c
commit
171ad403d9
|
@ -317,6 +317,10 @@ If enabled, any time a moderator is typing in a modmail thread, the user will se
|
|||
**Default:** `on`
|
||||
If enabled, the bot will automatically check for new bot updates periodically and notify about them at the top of new modmail threads
|
||||
|
||||
#### updateNotificationsForBetaVersions
|
||||
**Default:** `off`
|
||||
If enabled, update notifications will also be given for new beta versions
|
||||
|
||||
#### url
|
||||
**Default:** *None*
|
||||
URL to use for attachment and log links. Defaults to `http://IP:PORT`.
|
||||
|
|
|
@ -265,6 +265,11 @@
|
|||
"default": true
|
||||
},
|
||||
|
||||
"updateNotificationsForBetaVersions": {
|
||||
"$ref": "#/definitions/customBoolean",
|
||||
"default": false
|
||||
},
|
||||
|
||||
"plugins": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
@ -62,10 +62,10 @@ async function refreshVersions() {
|
|||
const parsed = JSON.parse(data);
|
||||
if (! Array.isArray(parsed) || parsed.length === 0) return;
|
||||
|
||||
const latestStableRelease = parsed.find(r => ! r.prerelease && ! r.draft);
|
||||
if (! latestStableRelease) return;
|
||||
const latestMatchingRelease = parsed.find(r => ! r.draft && (config.updateNotificationsForBetaVersions || ! r.prerelease));
|
||||
if (! latestMatchingRelease) return;
|
||||
|
||||
const latestVersion = latestStableRelease.name;
|
||||
const latestVersion = latestMatchingRelease.name;
|
||||
await knex("updates").update({
|
||||
available_version: latestVersion,
|
||||
last_checked: moment.utc().format("YYYY-MM-DD HH:mm:ss")
|
||||
|
|
Loading…
Reference in New Issue