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`
|
**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
|
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
|
#### url
|
||||||
**Default:** *None*
|
**Default:** *None*
|
||||||
URL to use for attachment and log links. Defaults to `http://IP:PORT`.
|
URL to use for attachment and log links. Defaults to `http://IP:PORT`.
|
||||||
|
|
|
@ -265,6 +265,11 @@
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"updateNotificationsForBetaVersions": {
|
||||||
|
"$ref": "#/definitions/customBoolean",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
|
|
@ -62,10 +62,10 @@ async function refreshVersions() {
|
||||||
const parsed = JSON.parse(data);
|
const parsed = JSON.parse(data);
|
||||||
if (! Array.isArray(parsed) || parsed.length === 0) return;
|
if (! Array.isArray(parsed) || parsed.length === 0) return;
|
||||||
|
|
||||||
const latestStableRelease = parsed.find(r => ! r.prerelease && ! r.draft);
|
const latestMatchingRelease = parsed.find(r => ! r.draft && (config.updateNotificationsForBetaVersions || ! r.prerelease));
|
||||||
if (! latestStableRelease) return;
|
if (! latestMatchingRelease) return;
|
||||||
|
|
||||||
const latestVersion = latestStableRelease.name;
|
const latestVersion = latestMatchingRelease.name;
|
||||||
await knex("updates").update({
|
await knex("updates").update({
|
||||||
available_version: latestVersion,
|
available_version: latestVersion,
|
||||||
last_checked: moment.utc().format("YYYY-MM-DD HH:mm:ss")
|
last_checked: moment.utc().format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
|
Loading…
Reference in New Issue