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(` + +

Error!

+

Code: ${data.error.code}
+ Message: ${data.error.message}
+ Double check the main page to ensure you've set things up right! +

+ `) + return + } var user = result.discord_user diff --git a/resources/userPage.html b/resources/userPage.html index 316d09d..f56c8ad 100644 --- a/resources/userPage.html +++ b/resources/userPage.html @@ -7,12 +7,14 @@ + + User - {DISPLAY_NAME}

{DISPLAY_NAME}

{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>

\ No newline at end of file diff --git a/static/embedStyle.css b/static/embedStyle.css index 785e167..24bbfa6 100644 --- a/static/embedStyle.css +++ b/static/embedStyle.css @@ -1,5 +1,5 @@ @import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"); -@import url('https://fonts.googleapis.com/css2?family=Rubik&family=Source+Code+Pro&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap'); body, input { font-family: 'Rubik', Verdana, Geneva, Tahoma, sans-serif; diff --git a/static/style.css b/static/style.css index a1d1dac..5d3b65a 100644 --- a/static/style.css +++ b/static/style.css @@ -1,5 +1,4 @@ @import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"); -@import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap'); body { background-color: rgb(40, 30, 60);