diff options
author | Ninjune x <enderknight537@gmail.com> | 2022-12-13 20:47:42 -0600 |
---|---|---|
committer | Ninjune x <enderknight537@gmail.com> | 2022-12-13 20:47:42 -0600 |
commit | 1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6 (patch) | |
tree | 2b6a36efccdade45d14a79a608b8dc6026fa3805 /chat/message.js | |
parent | ad055ba90a3055db32f04ff5163ff4e1c85dfdfa (diff) | |
download | coleweight-1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6.tar.gz coleweight-1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6.tar.bz2 coleweight-1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6.zip |
v1.8.0
Diffstat (limited to 'chat/message.js')
-rw-r--r-- | chat/message.js | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/chat/message.js b/chat/message.js index 79b6be1..27cf78f 100644 --- a/chat/message.js +++ b/chat/message.js @@ -40,6 +40,17 @@ register("chat", (level, typeOfChat, hypixelRank, username, playerMessage, event ChatLib.chat(newMessage) }).setCriteria(/^(\[\d+\] )?((?:(?:Guild|Party|Co-op) > )|(?:\[:v:\] ))?(\[\w+\+{0,2}\] )?(\w{1,16})(?: \[\w{1,6}\])?: (.*)$/g) +register("gameLoad", () => { + axios.get(`https://ninjune.dev/api/coleweight-leaderboard?length=500`) + .then(res => { + cwlbData = res.data + }) + .catch(err => { + ChatLib.chat(err) + }) +}) + + register("messageSent", (origMessage, event) => { // emotes! this was fun to make :) let commandState = 0, command = "", @@ -75,14 +86,21 @@ register("messageSent", (origMessage, event) => { // emotes! this was fun to mak ChatLib.say(`${message}`) }) -register("worldLoad", () => { - axios.get(`https://ninjune.dev/api/coleweight-leaderboard?length=500`) - .then(res => { - cwlbData = res.data - }) - .catch(err => { - ChatLib.chat(err) - }) -}) + +// first time check +register("step", () => { + if (constants.data.first_time) + { + constants.data.first_time = false + constants.data.save() + ChatLib.chat("") + new TextComponent(ChatLib.getCenteredText(`${PREFIX}&bPlease Set Your Api Key By Doing /api new`)).chat() + new TextComponent(ChatLib.getCenteredText(`${PREFIX}&bOr By Doing /cw setkey (key)`)).chat() + new TextComponent(ChatLib.getCenteredText(`${PREFIX}&bView commands: /cw help`)).chat() + ChatLib.chat("") + } + if (constants.data.api_key == undefined || constants.data.api_key == "") return +}).setFps(1); + export default ""
\ No newline at end of file |