From e55e71c8c2ee5fc6541eed04e9b684c6167e8f07 Mon Sep 17 00:00:00 2001 From: Ninjune Date: Wed, 26 Oct 2022 22:45:52 -0500 Subject: 1.5.0 Release --- util/updater.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 util/updater.js (limited to 'util/updater.js') diff --git a/util/updater.js b/util/updater.js new file mode 100644 index 0000000..dd497b6 --- /dev/null +++ b/util/updater.js @@ -0,0 +1,22 @@ +import axios from "../../axios" +import constants from "./constants" +PREFIX = constants.PREFIX +VERSION = constants.VERSION + +register("worldLoad", () => { + 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/${res.data.version}`) + .chat() + ChatLib.chat("") + }) + .catch(err => { + ChatLib.chat(err) + }) +}) + +export default "" \ No newline at end of file -- cgit