mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-01 08:17:25 +01:00
checkUnexistingObject lel
This commit is contained in:
parent
edc74ce59f
commit
b08b73ae52
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
|
||||
*/
|
||||
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue