small bugfix
This commit is contained in:
parent
f2757f08af
commit
85212051d0
@ -23,10 +23,9 @@ export default async bot => {
|
||||
f: e => {
|
||||
const links = e.message.match(regex.all)?.filter(link => !link.includes(cfg.main.url)) || [];
|
||||
let repost;
|
||||
|
||||
if(e.media)
|
||||
links.push(e.media);
|
||||
|
||||
|
||||
if(links.length === 0)
|
||||
return false;
|
||||
|
||||
@ -65,11 +64,12 @@ export default async bot => {
|
||||
ext = meta.ext;
|
||||
} catch(err) {
|
||||
const tmphead = (await fetch(link, { method: "HEAD" })).headers["content-type"];
|
||||
ext = tmphead;
|
||||
// this can be undefined for unsupported mime types, but will be caught in the general mime check below
|
||||
ext = cfg.mimes[tmphead];
|
||||
}
|
||||
|
||||
if(!Object.values(cfg.mimes).includes(ext.toLowerCase())) {
|
||||
return await e.reply('mime schmime '+ext);
|
||||
if(!Object.values(cfg.mimes).includes(ext?.toLowerCase())) {
|
||||
return 'mime schmime ' + ext;
|
||||
}
|
||||
|
||||
const msg = await e.reply(`[charging the f0cker] downloading: ${uuid}`, {
|
||||
|
Loading…
Reference in New Issue
Block a user