aboutsummaryrefslogtreecommitdiff
path: root/chat/message.js
diff options
context:
space:
mode:
authorNinjune <enderknight537@gmail.com>2022-12-02 17:42:08 -0600
committerNinjune <enderknight537@gmail.com>2022-12-02 17:42:08 -0600
commit1d26a47068b357c4a9f4cb0225aa063134e9a0d9 (patch)
treef5d62828a9330c47f4e3675197625c464f8a9400 /chat/message.js
parent86417e52fa78ea4096a155c2e70183d34aeaf530 (diff)
downloadcoleweight-1.6.11.tar.gz
coleweight-1.6.11.tar.bz2
coleweight-1.6.11.zip
v1.6.10v1.6.11
Diffstat (limited to 'chat/message.js')
-rw-r--r--chat/message.js35
1 files changed, 26 insertions, 9 deletions
diff --git a/chat/message.js b/chat/message.js
index 79b6be1..180e90b 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("worldLoad", () => {
+ 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,20 @@ 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