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 --- commands/setkey.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 commands/setkey.js (limited to 'commands/setkey.js') diff --git a/commands/setkey.js b/commands/setkey.js new file mode 100644 index 0000000..8024c0f --- /dev/null +++ b/commands/setkey.js @@ -0,0 +1,21 @@ +import constants from "../util/constants" +const PREFIX = constants.PREFIX + +export function setkey(arg2) +{ + if(arg2 == undefined) { ChatLib.chat(`${PREFIX}&eRequires an argument!`); return; } + else key = arg2 + + constants.data.api_key = key + constants.data.save() + axios.get(`https://api.hypixel.net/key?key=${constants.data.api_key}`) + .then(res => { + if(res.data.success == true) + ChatLib.chat(`${PREFIX}&aSuccsessfully set api key!`) + else + ChatLib.chat(`${PREFIX}&eKey is not valid!`) + }) + .catch(err => { + ChatLib.chat(`${PREFIX}&eKey is not valid!`) + }) +} \ No newline at end of file -- cgit