diff --git a/client.js b/client.js index dffdd19..75141a8 100644 --- a/client.js +++ b/client.js @@ -828,13 +828,19 @@ deek.on("message", async function(msg, user){ var res = await fetch("https://a.4cdn.org/" + chan4 + ".json"); var json = await res.json(); - if(typeof json.posts[0].sub == "undefined"){ + if(typeof json.posts[0] == "undefined"){ var title = "404 thread ded"; var description = "stupid fucking thread fuck this stupid site"; }else{ - var title = json.posts[0].sub; + if(typeof json.posts[0].sub == "undefined"){ + + var title = "No thread title"; + }else{ + + var title = json.posts[0].sub; + } var description = removehtml(json.posts[0].com); }