|
|
@ -21,7 +21,7 @@ await tokenHandler.getAccessToken((accessToken) => {
|
|
|
|
if (allowedMedia.find(type => type === sub.url.split(/[.]+/).pop())){
|
|
|
|
if (allowedMedia.find(type => type === sub.url.split(/[.]+/).pop())){
|
|
|
|
let filepath = `./media/${sub.url.split(/[/]+/).pop()}`;
|
|
|
|
let filepath = `./media/${sub.url.split(/[/]+/).pop()}`;
|
|
|
|
memeHandler.downloadMedia(sub.url, filepath, () => {
|
|
|
|
memeHandler.downloadMedia(sub.url, filepath, () => {
|
|
|
|
client.postMedia(status, filepath);
|
|
|
|
client.postMedia(status, filepath, 5, () => postRandomMeme());
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
console.log("no valid media, fetching new sub")
|
|
|
|
console.log("no valid media, fetching new sub")
|
|
|
|