This commit is contained in:
parent
f32d712dff
commit
f674fe2a40
@ -8,8 +8,9 @@ let context = vm.createContext({
|
||||
e: null,
|
||||
bot: null,
|
||||
admins: null,
|
||||
fetch: fetch,
|
||||
lib: lib,
|
||||
fetch,
|
||||
lib,
|
||||
console,
|
||||
|
||||
a: null,
|
||||
resolve: null
|
||||
|
@ -13,6 +13,7 @@ const regex = {
|
||||
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
|
||||
};
|
||||
const mediagroupids = new Set();
|
||||
|
||||
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')))
|
||||
return false;
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
//if(e.type === 'tg' && !e.message.match(/\!f(0ck)?\b/i) && typeof e.raw.forward_from == 'undefined')
|
||||
// return false;
|
||||
if(e.type === 'tg' &&
|
||||
@ -43,6 +45,18 @@ export default async bot => {
|
||||
) {
|
||||
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" : ""}...`);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user