revert
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 17s

This commit is contained in:
Flummi 2024-01-03 14:47:55 +01:00
parent f32d712dff
commit f674fe2a40
2 changed files with 17 additions and 2 deletions

View File

@ -8,8 +8,9 @@ let context = vm.createContext({
e: null, e: null,
bot: null, bot: null,
admins: null, admins: null,
fetch: fetch, fetch,
lib: lib, lib,
console,
a: null, a: null,
resolve: null resolve: null

View File

@ -13,6 +13,7 @@ const regex = {
yt: /(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\/?\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})/gi, yt: /(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\/?\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})/gi,
imgur: /^https?:\/\/(\w+\.)?imgur.com\/(\w*\d\w*)+(\.[a-zA-Z]{3,4})?/gi imgur: /^https?:\/\/(\w+\.)?imgur.com\/(\w*\d\w*)+(\.[a-zA-Z]{3,4})?/gi
}; };
const mediagroupids = new Set();
export default async bot => { export default async bot => {
@ -35,6 +36,7 @@ export default async bot => {
if(!e.channel.includes("f0ck") && (!e.message.match(/\!f(0ck)?\b/i) && (typeof e.raw.forward_from == 'undefined'))) if(!e.channel.includes("f0ck") && (!e.message.match(/\!f(0ck)?\b/i) && (typeof e.raw.forward_from == 'undefined')))
return false; return false;
<<<<<<< Updated upstream
//if(e.type === 'tg' && !e.message.match(/\!f(0ck)?\b/i) && typeof e.raw.forward_from == 'undefined') //if(e.type === 'tg' && !e.message.match(/\!f(0ck)?\b/i) && typeof e.raw.forward_from == 'undefined')
// return false; // return false;
if(e.type === 'tg' && if(e.type === 'tg' &&
@ -43,6 +45,18 @@ export default async bot => {
) { ) {
return false; return false;
} }
=======
if(e.type === 'tg' && // proto: tg
!e.message.match(/\!f(0ck)?\b/i) && // !f / !f0ck
!e.raw.forward_date && // is forwarded?
!mediagroupids.has(e.raw.media_group_id) // prepared mediagroup?
) {
return false;
}
else if(e.raw.media_group_id && e.message.match(/\!f(0ck)?\b/i)) {
mediagroupids.add(e.raw.media_group_id);
}
>>>>>>> Stashed changes
console.log(`parsing ${links.length} link${links.length > 1 ? "s" : ""}...`); console.log(`parsing ${links.length} link${links.length > 1 ? "s" : ""}...`);