aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorNinjune x <enderknight537@gmail.com>2022-11-05 01:03:13 -0500
committerNinjune x <enderknight537@gmail.com>2022-11-05 01:03:13 -0500
commit9085ac77ce364572b14f132b64ead5cde2194607 (patch)
tree73cf21277044c698fdac30a59f099ee99dfe3e4e /util
parenta88703e10f4430b7e8ae6c745caf52b6e45d796f (diff)
downloadcoleweight-9085ac77ce364572b14f132b64ead5cde2194607.tar.gz
coleweight-9085ac77ce364572b14f132b64ead5cde2194607.tar.bz2
coleweight-9085ac77ce364572b14f132b64ead5cde2194607.zip
Updated updater.v1.5.4
Diffstat (limited to 'util')
-rw-r--r--util/updater.js39
1 files changed, 28 insertions, 11 deletions
diff --git a/util/updater.js b/util/updater.js
index edc20f8..43693e3 100644
--- a/util/updater.js
+++ b/util/updater.js
@@ -4,19 +4,36 @@ PREFIX = constants.PREFIX
VERSION = constants.VERSION
register("worldLoad", () => {
- axios.get(`https://raw.githubusercontent.com/Ninjune/coleweight/main/metadata.json`)
+ axios.get(`https://chattriggers.com/api/modules/1367`)
.then(res => {
- if(res.data.version == VERSION) return
- ChatLib.chat(`${PREFIX}&eYou are using an unsupported version of Coleweight!`)
- new TextComponent(`${PREFIX}&eClick &3here&e to open the github releases!`)
- .setClickAction("open_url")
- .setClickValue(`https://github.com/Ninjune/coleweight/releases`)
- .chat()
- ChatLib.chat("")
- })
- .catch(err => {
- ChatLib.chat(err)
+ if(res.data.releases[0].releaseVersion != VERSION)
+ {
+ ChatLib.chat(`${PREFIX}&eYou are using an unsupported version of Coleweight!`)
+ new TextComponent(`${PREFIX}&eClick &3here&e to update!`)
+ .setClickAction("run_command")
+ .setClickValue(`/ct load`)
+ .chat()
+ ChatLib.chat("")
+ }
+ else
+ {
+ axios.get(`https://raw.githubusercontent.com/Ninjune/coleweight/main/metadata.json`)
+ .then(res => {
+ if(res.data.version == VERSION) return
+ ChatLib.chat(`${PREFIX}&eYou are using an unsupported version of Coleweight!`)
+ new TextComponent(`${PREFIX}&eClick &3here&e to open the github releases!`)
+ .setClickAction("open_url")
+ .setClickValue(`https://github.com/Ninjune/coleweight/releases`)
+ .chat()
+ ChatLib.chat("")
+ return
+ })
+ .catch(err => {
+ ChatLib.chat(err)
+ })
+ }
})
+
})
export default "" \ No newline at end of file