diff --git a/index.js b/index.js index 7716173..df70e45 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,21 @@ app.get('/getUser', async (req, res) => { res.header("Content-Type", "text/html") var html = fs.readFileSync(path.join(__dirname, 'resources/userPage.html')).toString() - var result = (await fetch(`https://api.lanyard.rest/v1/users/${discID}`).then(response => response.json())).data + var data = (await fetch(`https://api.lanyard.rest/v1/users/${discID}`).then(response => response.json())) + + var result = data.data + + if (data.error) { + res.send(` + +
Code: ${data.error.code}
+ Message: ${data.error.message}
+ Double check the main page to ensure you've set things up right!
+
{USERNAME}
-Code to embed:
<iframe style="width: 90%; max-width: 750px; height: 300px;" src="{BASE_LINK}embedCard?discordid={DISCORD_ID}"></iframe>
Code to embed:
<iframe style="width: 90%; max-width: 750px; height: 300px;" src="{BASE_LINK}embedCard?discordid={DISCORD_ID}"></iframe>