aboutsummaryrefslogtreecommitdiff
path: root/chat/apiNew.js
blob: 76a24188147979e16c1db73a8691cb7138c1a684 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import constants from "../util/constants"
import axios from "../../axios"
const PREFIX = constants.PREFIX


register("chat", (key) => {
    axios.get(`https://api.hypixel.net/key?key=${key}`)
    .then(res => {
        if(res.data.success == true)
        {
            constants.data.api_key = key
            constants.data.save()
            ChatLib.chat(`${PREFIX}&aSuccsessfully set api key!`)
        }
        else
            ChatLib.chat(`${PREFIX}&eKey is not valid!`)
    })
    .catch(err => {
        ChatLib.chat(`${PREFIX}&eKey is not valid! if this is a mistake report: ${err}`)
    })
    ChatLib.chat(`${PREFIX}&aApi Key Successfully Set!`)
}).setCriteria(/Your new API key is (.+)/)

export default ""