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 /commands/fetchDiscord.js | |
parent | ad055ba90a3055db32f04ff5163ff4e1c85dfdfa (diff) | |
download | coleweight-1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6.tar.gz coleweight-1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6.tar.bz2 coleweight-1891ada92ab1911cfaaa7ad0e72c85573f4fcbb6.zip |
v1.8.0
Diffstat (limited to 'commands/fetchDiscord.js')
-rw-r--r-- | commands/fetchDiscord.js | 12 |
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)`) |