aboutsummaryrefslogtreecommitdiff
path: root/commands/findColeweight.js
diff options
context:
space:
mode:
authorNinjune <enderknight537@gmail.com>2022-11-08 13:30:41 -0600
committerNinjune <enderknight537@gmail.com>2022-11-08 13:30:41 -0600
commite72c42345ef32fe9f3eeaf92844c0b77f175fac6 (patch)
treea67ca92dfd4bbd5df1fcdf1beccad9bc0ba36da8 /commands/findColeweight.js
parentf2d535d6979cf6cb04a7245925a5bcf71bee2c67 (diff)
downloadcoleweight-1.5.5.tar.gz
coleweight-1.5.5.tar.bz2
coleweight-1.5.5.zip
1.5.4 Fixed bugs (changelog in discord)v1.5.5
Diffstat (limited to 'commands/findColeweight.js')
-rw-r--r--commands/findColeweight.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/commands/findColeweight.js b/commands/findColeweight.js
new file mode 100644
index 0000000..d3fa38a
--- /dev/null
+++ b/commands/findColeweight.js
@@ -0,0 +1,22 @@
+import axios from "../../axios"
+import constants from "../util/constants"
+const PREFIX = constants.PREFIX
+
+export function findColeweight(arg)
+{
+ ChatLib.chat(`${PREFIX}Finding Coleweight!`)
+ let username = ""
+ if(arg == undefined)
+ username = Player.getUUID()
+ else
+ username = arg
+ axios.get(`https://ninjune.dev/api/coleweight?username=${username}`)
+ .then(res => {
+ let coleweightMessage = new TextComponent(`${PREFIX}&b${res.data.rank}. ${res.data.name}&b's Coleweight: ${res.data.coleweight} (Top &l${res.data.percentile}&b%)`)
+ .setHoverValue(`&fExperience&f: &a${res.data.exp}\n&fPowder&f: &a${res.data.pow}\n&fCollection&f: &a${res.data.col}\n&fMiscellaneous&f: &a${res.data.bes + res.data.nuc}`)
+ ChatLib.chat(coleweightMessage)
+ })
+ .catch(err => {
+ ChatLib.chat(`${PREFIX}&eError. (api may be down)`)
+ })
+} \ No newline at end of file