diff options
| author | Ninjune <enderknight537@gmail.com> | 2022-11-08 13:30:41 -0600 |
|---|---|---|
| committer | Ninjune <enderknight537@gmail.com> | 2022-11-08 13:30:41 -0600 |
| commit | e72c42345ef32fe9f3eeaf92844c0b77f175fac6 (patch) | |
| tree | a67ca92dfd4bbd5df1fcdf1beccad9bc0ba36da8 /util/updater.js | |
| parent | f2d535d6979cf6cb04a7245925a5bcf71bee2c67 (diff) | |
| download | coleweight-1.5.5.tar.gz coleweight-1.5.5.tar.bz2 coleweight-1.5.5.zip | |
1.5.4 Fixed bugs (changelog in discord)v1.5.5
Diffstat (limited to 'util/updater.js')
| -rw-r--r-- | util/updater.js | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/util/updater.js b/util/updater.js index edc20f8..64fbe1b 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 && constants.beta == false) + { + 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 || constants.beta == true) 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 |
