aboutsummaryrefslogtreecommitdiff
path: root/commands/info.js
diff options
context:
space:
mode:
authorNinjune <enderknight537@gmail.com>2022-12-22 03:21:02 -0600
committerNinjune <enderknight537@gmail.com>2022-12-22 03:21:02 -0600
commit329dccf50ed5e9f87531580f679522238b6a019b (patch)
tree3053852d322db744822a7dd2a05fd59d2b1e90b7 /commands/info.js
parent1ffc0a89be42fcde95a04a87cc00dbc347b27ece (diff)
downloadcoleweight-329dccf50ed5e9f87531580f679522238b6a019b.tar.gz
coleweight-329dccf50ed5e9f87531580f679522238b6a019b.tar.bz2
coleweight-329dccf50ed5e9f87531580f679522238b6a019b.zip
v1.8.3
Diffstat (limited to 'commands/info.js')
-rw-r--r--commands/info.js29
1 files changed, 13 insertions, 16 deletions
diff --git a/commands/info.js b/commands/info.js
index 3967863..ed427f8 100644
--- a/commands/info.js
+++ b/commands/info.js
@@ -1,23 +1,20 @@
-import axios from "../../axios"
import constants from "../util/constants"
+import { addCommas } from "../util/helperFunctions"
const PREFIX = constants.PREFIX
export function info()
{
- axios.get(`https://ninjune.dev/api/cwinfo`)
- .then((res) => {
- let values = res.data,
- powder = values.powder,
- collection = values.collection,
- miscellaneous = values.miscellaneous
-
- ChatLib.chat(`${PREFIX}&bEach of the following are equivalent to one unit of ColeWeight` +
- `\n\n&4&lExperience \n&b${values.experience.req} mining exp` +
- `\n\n&4&lPowder \n&b${powder[0].req} &bmithril powder\n&b${powder[1].req} gemstone powder` + // in theory I should have just added formatted names to the api
- `\n\n&4&lCollections \n&b${collection[0].req} &bmithril\n&b${collection[1].req} gemstone\n&b${collection[2].req} gold\n&b${collection[3].req}netherrack\n&b${collection[4].req} diamond\n&b${collection[5].req} ice\n&b${collection[6].req} redstone\n&b${collection[7].req} lapis\n&b${collection[8].req} sulphur\n&b${collection[9].req} coal\n&b${collection[10].req} emerald\n&b${collection[11].req} endstone\n&b${collection[12].req} glowstone\n&b${collection[13].req} gravel\n&b${collection[14].req} iron\n&b${collection[15].req} mycelium\n&b${collection[16].req} quartz\n&b${collection[17].req} obsidian\n&b${collection[18].req} red sand\n&b${collection[19].req} sand\n&b${collection[20].req} cobblestone\n&b${collection[21].req} hardstone` +
- `\n\n&4&lMiscellaneous \n&b${miscellaneous[0].req} scatha kills\n&b${miscellaneous[1].req} worm kills\n&b${miscellaneous[2].req} nucleus runs`)
- })
- .catch((e) => {
- return `${PREFIX}&cThere was an error. (api may be down)`
+ let cwinfo = constants.CWINFO,
+ values = {"experience" : "", "powder": "", "collection": "", "miscellaneous": ""}
+
+ cwinfo.forEach(info => {
+ values[info.category] += `&b${addCommas(info.cost)} ${info.nameStringed}\n`
})
+
+ ChatLib.chat(
+ `${PREFIX}&bEach of the following are equivalent to one unit of ColeWeight` +
+ "\n&4&lExperience\n" + values.experience +
+ "\n&4&lPowder\n" + values.powder +
+ "\n&4&lCollections\n" + values.collection +
+ "\n&4&lMiscellaneous\n" + values.miscellaneous)
} \ No newline at end of file