checkUnexistingObject lel

This commit is contained in:
Ashley 2022-12-16 19:11:53 +00:00
parent e6f153bb78
commit 380c66ed01

View file

@ -36,6 +36,14 @@ function getJson(str) {
}
}
function checkUnexistingObject(obj) {
if (obj !== undefined) {
if (obj.authorId !== undefined) {
return true;
}
}
}
/*
* Api functions
*/
@ -72,6 +80,7 @@ async function video(v) {
);
var vid = await getJson(video_new_info);
if(checkUnexistingObject(vid)) {
const a = await fetch(`${config.tubeApi}channel?id=${vid.authorId}&tab=about`)
.then((res) => res.text())
@ -104,6 +113,7 @@ async function video(v) {
).then((colors) => colors[1].hex()),
};
}
}
async function search(query, cnt) {
if (query == null) return "Gib Query";