mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 16:38:17 +01:00
checkUnexistingObject lel
This commit is contained in:
parent
e6f153bb78
commit
380c66ed01
1 changed files with 12 additions and 2 deletions
|
@ -36,6 +36,14 @@ function getJson(str) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkUnexistingObject(obj) {
|
||||||
|
if (obj !== undefined) {
|
||||||
|
if (obj.authorId !== undefined) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Api functions
|
* Api functions
|
||||||
*/
|
*/
|
||||||
|
@ -72,6 +80,7 @@ async function video(v) {
|
||||||
);
|
);
|
||||||
|
|
||||||
var vid = await getJson(video_new_info);
|
var vid = await getJson(video_new_info);
|
||||||
|
if(checkUnexistingObject(vid)) {
|
||||||
|
|
||||||
const a = await fetch(`${config.tubeApi}channel?id=${vid.authorId}&tab=about`)
|
const a = await fetch(`${config.tubeApi}channel?id=${vid.authorId}&tab=about`)
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
|
@ -104,6 +113,7 @@ async function video(v) {
|
||||||
).then((colors) => colors[1].hex()),
|
).then((colors) => colors[1].hex()),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function search(query, cnt) {
|
async function search(query, cnt) {
|
||||||
if (query == null) return "Gib Query";
|
if (query == null) return "Gib Query";
|
||||||
|
|
Loading…
Reference in a new issue