aboutsummaryrefslogtreecommitdiff
path: root/commands/fetchDiscord.js
diff options
context:
space:
mode:
authorNinjune <enderknight537@gmail.com>2022-12-04 17:04:15 -0600
committerNinjune <enderknight537@gmail.com>2022-12-04 17:04:15 -0600
commit8ad19e54f6c3f44a84dd2565d910c207ffc5bc52 (patch)
tree88bf7492232501b471ca1cb52b2acf0969437759 /commands/fetchDiscord.js
parent1d26a47068b357c4a9f4cb0225aa063134e9a0d9 (diff)
downloadcoleweight-8ad19e54f6c3f44a84dd2565d910c207ffc5bc52.tar.gz
coleweight-8ad19e54f6c3f44a84dd2565d910c207ffc5bc52.tar.bz2
coleweight-8ad19e54f6c3f44a84dd2565d910c207ffc5bc52.zip
v1.6.11
Diffstat (limited to 'commands/fetchDiscord.js')
-rw-r--r--commands/fetchDiscord.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/commands/fetchDiscord.js b/commands/fetchDiscord.js
index f44c385..f254edb 100644
--- a/commands/fetchDiscord.js
+++ b/commands/fetchDiscord.js
@@ -6,14 +6,14 @@ export function fetchDiscord(arg)
{
if(arg == undefined) { ChatLib.chat(`${PREFIX}&eRequires a username!`); return }
- axios.get(`https://api.ashcon.app/mojang/v2/user/${arg}`)
- .then(res => {
- let uuid = res.data.uuid
+ axios.get(`https://api.mojang.com/users/profiles/minecraft/${arg}`)
+ .then(mojangRes => {
+ let uuid = mojangRes.data.id
axios.get(`https://api.hypixel.net/player?key=${constants.data.api_key}&uuid=${uuid}`)
- .then(res2 => {
- let discordMessage = new TextComponent(`${PREFIX}&a${res.data.username}'s Discord: `)
+ .then(hypixelRes => {
+ let discordMessage = new TextComponent(`${PREFIX}&a${mojangRes.data.name}'s Discord: `)
ChatLib.chat(discordMessage);
- ChatLib.chat(`&b${res2.data.player.socialMedia.links.DISCORD}`)
+ ChatLib.chat(`&b${hypixelRes.data.player.socialMedia.links.DISCORD}`)
})
.catch(err => {
ChatLib.chat(`${PREFIX}&eNo discord linked :( (or no key linked)`)