aboutsummaryrefslogtreecommitdiff
path: root/util/updater.js
blob: dd497b67b9d5beb8607ee13917f2ec2c46edf124 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 ""