jsdecryptor 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Database/database.js +446 -0
- package/Database/migration.js +327 -0
- package/Database/pgSync.js +229 -0
- package/Database/settingsStore.js +305 -0
- package/config.js +32 -0
- package/dave.js +3063 -0
- package/davelib/antibadword.js +278 -0
- package/davelib/antilink.js +88 -0
- package/davelib/antilinkHelper.js +48 -0
- package/davelib/botConfig.js +71 -0
- package/davelib/connect4.js +111 -0
- package/davelib/converter.js +89 -0
- package/davelib/dicegame.js +114 -0
- package/davelib/exif.js +138 -0
- package/davelib/fakeContact.js +85 -0
- package/davelib/fontStyles.js +237 -0
- package/davelib/greetings.js +47 -0
- package/davelib/id.js +11 -0
- package/davelib/index.js +577 -0
- package/davelib/isAdmin.js +32 -0
- package/davelib/isBanned.js +12 -0
- package/davelib/isOwner.js +15 -0
- package/davelib/lightweight_store.js +169 -0
- package/davelib/messageConfig.js +15 -0
- package/davelib/messageHandler.js +87 -0
- package/davelib/myfunc.js +379 -0
- package/davelib/myfunc2.js +170 -0
- package/davelib/reactions.js +180 -0
- package/davelib/server.html +563 -0
- package/davelib/sticker.js +208 -0
- package/davelib/tempCleanup.js +53 -0
- package/davelib/tictactoe.js +104 -0
- package/davelib/uploadImage.js +100 -0
- package/davelib/uploader.js +110 -0
- package/davelib/welcome.js +100 -0
- package/davelib/wordchain.js +121 -0
- package/daveset.js +16 -0
- package/davexcore/ai/ai.js +100 -0
- package/davexcore/ai/aiGpt4.js +59 -0
- package/davexcore/ai/aimodels.js +284 -0
- package/davexcore/ai/aivideo.js +31 -0
- package/davexcore/ai/analyze.js +233 -0
- package/davexcore/ai/bard.js +101 -0
- package/davexcore/ai/bird.js +101 -0
- package/davexcore/ai/blackbox.js +30 -0
- package/davexcore/ai/character.js +80 -0
- package/davexcore/ai/copilot.js +58 -0
- package/davexcore/ai/dalle.js +39 -0
- package/davexcore/ai/davex.js +50 -0
- package/davexcore/ai/deepseek.js +96 -0
- package/davexcore/ai/grok.js +67 -0
- package/davexcore/ai/imagine.js +89 -0
- package/davexcore/ai/meta.js +82 -0
- package/davexcore/ai/mistral.js +101 -0
- package/davexcore/ai/perplexity.js +95 -0
- package/davexcore/ai/sora.js +44 -0
- package/davexcore/ai/speechwriter.js +46 -0
- package/davexcore/ai/vision.js +244 -0
- package/davexcore/ai/wormgpt.js +56 -0
- package/davexcore/anti/antiaudio.js +106 -0
- package/davexcore/anti/antibadword.js +313 -0
- package/davexcore/anti/antibug.js +156 -0
- package/davexcore/anti/anticall.js +219 -0
- package/davexcore/anti/antichart.js +280 -0
- package/davexcore/anti/antidelete.js +673 -0
- package/davexcore/anti/antideletestatus.js +535 -0
- package/davexcore/anti/antidemote.js +352 -0
- package/davexcore/anti/antidocument.js +105 -0
- package/davexcore/anti/antiedit.js +410 -0
- package/davexcore/anti/antifiles.js +109 -0
- package/davexcore/anti/antigroupmention.js +206 -0
- package/davexcore/anti/antiimage.js +105 -0
- package/davexcore/anti/antikick.js +125 -0
- package/davexcore/anti/antilink.js +237 -0
- package/davexcore/anti/antimention.js +143 -0
- package/davexcore/anti/antipromote.js +320 -0
- package/davexcore/anti/antisticker.js +105 -0
- package/davexcore/anti/antitag.js +191 -0
- package/davexcore/anti/antivideo.js +105 -0
- package/davexcore/anti/antiviewonce.js +396 -0
- package/davexcore/anti/groupanticall.js +262 -0
- package/davexcore/anti/mention.js +242 -0
- package/davexcore/automation/alwaysonline.js +226 -0
- package/davexcore/automation/autoReadReciepts.js +96 -0
- package/davexcore/automation/autoread.js +104 -0
- package/davexcore/automation/autorecording.js +197 -0
- package/davexcore/automation/autostatus.js +317 -0
- package/davexcore/automation/autotyping.js +197 -0
- package/davexcore/automation/chatbot.js +444 -0
- package/davexcore/automation/chatmanage.js +199 -0
- package/davexcore/automation/devReact.js +43 -0
- package/davexcore/automation/goodbye.js +181 -0
- package/davexcore/automation/greetings.js +154 -0
- package/davexcore/automation/welcome.js +187 -0
- package/davexcore/downloads/apk.js +157 -0
- package/davexcore/downloads/facebook.js +94 -0
- package/davexcore/downloads/gitclone.js +137 -0
- package/davexcore/downloads/igs.js +333 -0
- package/davexcore/downloads/instagram.js +133 -0
- package/davexcore/downloads/mediafire.js +144 -0
- package/davexcore/downloads/pinterest.js +38 -0
- package/davexcore/downloads/play.js +158 -0
- package/davexcore/downloads/saveStatus.js +3 -0
- package/davexcore/downloads/song.js +135 -0
- package/davexcore/downloads/spotify.js +133 -0
- package/davexcore/downloads/tiktok.js +167 -0
- package/davexcore/downloads/tiktokaudio.js +158 -0
- package/davexcore/downloads/video.js +188 -0
- package/davexcore/downloads/ytdl.js +252 -0
- package/davexcore/downloads/ytdocplay.js +130 -0
- package/davexcore/downloads/ytdocvideo.js +95 -0
- package/davexcore/downloads/yts.js +64 -0
- package/davexcore/games/connect4.js +267 -0
- package/davexcore/games/dice.js +286 -0
- package/davexcore/games/eightball.js +24 -0
- package/davexcore/games/hangman.js +60 -0
- package/davexcore/games/rps.js +25 -0
- package/davexcore/games/ship.js +36 -0
- package/davexcore/games/slot.js +21 -0
- package/davexcore/games/tictactoe.js +263 -0
- package/davexcore/games/trivia.js +46 -0
- package/davexcore/games/wordchain.js +242 -0
- package/davexcore/group/addmember.js +101 -0
- package/davexcore/group/ban.js +63 -0
- package/davexcore/group/blockUnblock.js +177 -0
- package/davexcore/group/clear.js +196 -0
- package/davexcore/group/creategroup.js +43 -0
- package/davexcore/group/demote.js +115 -0
- package/davexcore/group/disappear.js +67 -0
- package/davexcore/group/groupinfo.js +167 -0
- package/davexcore/group/groupmanage.js +133 -0
- package/davexcore/group/hidetag.js +108 -0
- package/davexcore/group/joinrequests.js +145 -0
- package/davexcore/group/kick.js +92 -0
- package/davexcore/group/kickall.js +63 -0
- package/davexcore/group/leave.js +38 -0
- package/davexcore/group/linkgroup.js +63 -0
- package/davexcore/group/mute.js +57 -0
- package/davexcore/group/online.js +117 -0
- package/davexcore/group/pmblocker.js +65 -0
- package/davexcore/group/promote.js +93 -0
- package/davexcore/group/resetlink.js +57 -0
- package/davexcore/group/staff.js +99 -0
- package/davexcore/group/tag.js +111 -0
- package/davexcore/group/tagadmins.js +88 -0
- package/davexcore/group/tagall.js +99 -0
- package/davexcore/group/tagnotadmin.js +92 -0
- package/davexcore/group/topmembers.js +202 -0
- package/davexcore/group/unban.js +64 -0
- package/davexcore/group/unmute.js +45 -0
- package/davexcore/group/warn.js +83 -0
- package/davexcore/group/warnings.js +26 -0
- package/davexcore/media/anime.js +130 -0
- package/davexcore/media/attp.js +127 -0
- package/davexcore/media/design.js +52 -0
- package/davexcore/media/emojimix.js +105 -0
- package/davexcore/media/getpp.js +108 -0
- package/davexcore/media/image.js +87 -0
- package/davexcore/media/imageedit.js +329 -0
- package/davexcore/media/img-blur.js +70 -0
- package/davexcore/media/meme.js +35 -0
- package/davexcore/media/pies.js +53 -0
- package/davexcore/media/quotesticker.js +153 -0
- package/davexcore/media/remini.js +126 -0
- package/davexcore/media/removebg.js +114 -0
- package/davexcore/media/setpp.js +65 -0
- package/davexcore/media/shazam.js +251 -0
- package/davexcore/media/simage.js +74 -0
- package/davexcore/media/sticker.js +134 -0
- package/davexcore/media/stickercrop.js +133 -0
- package/davexcore/media/stickertelegram.js +133 -0
- package/davexcore/media/take.js +76 -0
- package/davexcore/media/textmaker.js +106 -0
- package/davexcore/media/toAudio.js +180 -0
- package/davexcore/media/togif.js +33 -0
- package/davexcore/media/toimg.js +26 -0
- package/davexcore/media/tomp4.js +34 -0
- package/davexcore/media/tostatus.js +160 -0
- package/davexcore/media/tts.js +47 -0
- package/davexcore/media/viewonce.js +59 -0
- package/davexcore/media/vn.js +67 -0
- package/davexcore/media/vv2.js +3 -0
- package/davexcore/media/wallpaper.js +89 -0
- package/davexcore/media/wasted.js +57 -0
- package/davexcore/misc/compliment.js +93 -0
- package/davexcore/misc/dare.js +47 -0
- package/davexcore/misc/fact.js +14 -0
- package/davexcore/misc/flirt.js +26 -0
- package/davexcore/misc/goodnight.js +33 -0
- package/davexcore/misc/insult.js +281 -0
- package/davexcore/misc/joke.js +66 -0
- package/davexcore/misc/misc.js +200 -0
- package/davexcore/misc/quote.js +22 -0
- package/davexcore/misc/roseday.js +24 -0
- package/davexcore/misc/shayari.js +62 -0
- package/davexcore/misc/simp.js +47 -0
- package/davexcore/misc/stupid.js +51 -0
- package/davexcore/misc/truth.js +146 -0
- package/davexcore/owner/alive.js +67 -0
- package/davexcore/owner/bio.js +49 -0
- package/davexcore/owner/broadcast.js +74 -0
- package/davexcore/owner/chanel.js +79 -0
- package/davexcore/owner/channelid.js +50 -0
- package/davexcore/owner/clearsession.js +86 -0
- package/davexcore/owner/help.js +649 -0
- package/davexcore/owner/hijack.js +69 -0
- package/davexcore/owner/menuManage.js +173 -0
- package/davexcore/owner/menuSettings.js +1 -0
- package/davexcore/owner/owner.js +17 -0
- package/davexcore/owner/pair.js +160 -0
- package/davexcore/owner/pinchat.js +44 -0
- package/davexcore/owner/ping.js +65 -0
- package/davexcore/owner/profilepic.js +61 -0
- package/davexcore/owner/resetmenuimage.js +16 -0
- package/davexcore/owner/setGroupStatus.js +315 -0
- package/davexcore/owner/setbotconfig.js +306 -0
- package/davexcore/owner/setfont.js +79 -0
- package/davexcore/owner/setowner.js +144 -0
- package/davexcore/owner/setprefix.js +131 -0
- package/davexcore/owner/settings.js +98 -0
- package/davexcore/owner/startupwelcome.js +94 -0
- package/davexcore/owner/sudo.js +138 -0
- package/davexcore/owner/update.js +282 -0
- package/davexcore/tmp/1772020249097.jpg +0 -0
- package/davexcore/utility/bible.js +239 -0
- package/davexcore/utility/cleartmp.js +107 -0
- package/davexcore/utility/delete.js +182 -0
- package/davexcore/utility/encrypt.js +99 -0
- package/davexcore/utility/ethicalhacking.js +108 -0
- package/davexcore/utility/fetch.js +127 -0
- package/davexcore/utility/github.js +85 -0
- package/davexcore/utility/google.js +79 -0
- package/davexcore/utility/join.js +52 -0
- package/davexcore/utility/lastseen.js +67 -0
- package/davexcore/utility/location.js +106 -0
- package/davexcore/utility/lyrics.js +54 -0
- package/davexcore/utility/movie.js +66 -0
- package/davexcore/utility/news.js +37 -0
- package/davexcore/utility/sports.js +403 -0
- package/davexcore/utility/ss.js +63 -0
- package/davexcore/utility/tinyurl.js +83 -0
- package/davexcore/utility/translate.js +101 -0
- package/davexcore/utility/url.js +112 -0
- package/davexcore/utility/vcf.js +84 -0
- package/davexcore/utility/weather.js +162 -0
- package/index.js +994 -0
- package/package.json +64 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
const { getGroupConfig, setGroupConfig, deleteGroupToggle } = require('../../Database/settingsStore');
|
|
2
|
+
const isAdmin = require('../../davelib/isAdmin');
|
|
3
|
+
const db = require('../../Database/database');
|
|
4
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
5
|
+
const { getPrefix } = require('../owner/setprefix');
|
|
6
|
+
|
|
7
|
+
const antitagStats = new Map();
|
|
8
|
+
|
|
9
|
+
async function handleAntitagCommand(sock, chatId, userMessage, senderId, isSenderAdmin, message) {
|
|
10
|
+
try {
|
|
11
|
+
const fake = createFakeContact(senderId);
|
|
12
|
+
const botName = getBotName();
|
|
13
|
+
const prefix = getPrefix();
|
|
14
|
+
|
|
15
|
+
if (!isSenderAdmin && !message?.key?.fromMe && !db.isSudo(senderId)) {
|
|
16
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAdmin only command!` }, { quoted: fake });
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const args = userMessage.slice(9).toLowerCase().trim().split(' ');
|
|
21
|
+
const action = args[0];
|
|
22
|
+
|
|
23
|
+
if (!action) {
|
|
24
|
+
const config = getGroupConfig(chatId, 'antitag') || { enabled: false };
|
|
25
|
+
const currentAction = config.enabled ? (config.action || 'delete') : 'off';
|
|
26
|
+
const usage = `*${botName} ANTITAG*\n\nStatus: ${config.enabled ? 'ON' : 'OFF'}\nAction: ${currentAction}\n\n*Commands:*\n${prefix}antitag on - Enable\n${prefix}antitag off - Disable\n${prefix}antitag set delete|kick - Set action\n${prefix}antitag stats - View stats`;
|
|
27
|
+
await sock.sendMessage(chatId, { text: usage }, { quoted: fake });
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
switch (action) {
|
|
32
|
+
case 'on':
|
|
33
|
+
const existingConfig = getGroupConfig(chatId, 'antitag');
|
|
34
|
+
if (existingConfig?.enabled) {
|
|
35
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAntitag already ON!` }, { quoted: fake });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setGroupConfig(chatId, 'antitag', { enabled: true, action: 'delete' });
|
|
39
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAntitag ENABLED` }, { quoted: fake });
|
|
40
|
+
break;
|
|
41
|
+
|
|
42
|
+
case 'off':
|
|
43
|
+
deleteGroupToggle(chatId, 'antitag');
|
|
44
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAntitag DISABLED` }, { quoted: fake });
|
|
45
|
+
break;
|
|
46
|
+
|
|
47
|
+
case 'set':
|
|
48
|
+
const mode = args[1];
|
|
49
|
+
if (!mode || !['delete', 'kick'].includes(mode)) {
|
|
50
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nUse: ${prefix}antitag set delete|kick` }, { quoted: fake });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setGroupConfig(chatId, 'antitag', { enabled: true, action: mode });
|
|
54
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAntitag action: ${mode.toUpperCase()}` }, { quoted: fake });
|
|
55
|
+
break;
|
|
56
|
+
|
|
57
|
+
case 'stats':
|
|
58
|
+
const stats = antitagStats.get(chatId) || { blocked: 0 };
|
|
59
|
+
await sock.sendMessage(chatId, {
|
|
60
|
+
text: `*${botName} ANTITAG STATS*\n\nBlocked: ${stats.blocked} tagalls`
|
|
61
|
+
}, { quoted: fake });
|
|
62
|
+
break;
|
|
63
|
+
|
|
64
|
+
default:
|
|
65
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nUnknown option!` }, { quoted: fake });
|
|
66
|
+
}
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error('Error in handleAntitagCommand:', error.message, 'Line:', error.stack?.split('\n')[1]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function handleTagDetection(sock, message) {
|
|
73
|
+
try {
|
|
74
|
+
const chatId = message.key.remoteJid;
|
|
75
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
76
|
+
|
|
77
|
+
if (!chatId.endsWith('@g.us')) return false;
|
|
78
|
+
|
|
79
|
+
const config = getGroupConfig(chatId, 'antitag');
|
|
80
|
+
if (!config || !config.enabled) return false;
|
|
81
|
+
|
|
82
|
+
const { isSenderAdmin, isBotAdmin } = await isAdmin(sock, chatId, senderId);
|
|
83
|
+
if (!isBotAdmin || isSenderAdmin || db.isSudo(senderId)) return false;
|
|
84
|
+
|
|
85
|
+
const mentions = message.message?.extendedTextMessage?.contextInfo?.mentionedJid || [];
|
|
86
|
+
|
|
87
|
+
if (mentions.length < 5) return false;
|
|
88
|
+
|
|
89
|
+
const botName = getBotName();
|
|
90
|
+
const userTag = `@${senderId.split("@")[0]}`;
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
await sock.sendMessage(chatId, {
|
|
94
|
+
delete: {
|
|
95
|
+
remoteJid: chatId,
|
|
96
|
+
fromMe: false,
|
|
97
|
+
id: message.key.id,
|
|
98
|
+
participant: senderId
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
} catch (e) {
|
|
102
|
+
console.error("[ANTITAG] Delete failed:", e.message);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const stats = antitagStats.get(chatId) || { blocked: 0 };
|
|
107
|
+
stats.blocked++;
|
|
108
|
+
antitagStats.set(chatId, stats);
|
|
109
|
+
|
|
110
|
+
if (config.action === 'kick') {
|
|
111
|
+
await sock.sendMessage(chatId, {
|
|
112
|
+
text: `*${botName}*\n\n${userTag} kicked for mass tagging!`,
|
|
113
|
+
mentions: [senderId]
|
|
114
|
+
});
|
|
115
|
+
await sock.groupParticipantsUpdate(chatId, [senderId], 'remove');
|
|
116
|
+
} else {
|
|
117
|
+
await sock.sendMessage(chatId, {
|
|
118
|
+
text: `*${botName}*\n\n${userTag}, mass tagging is not allowed!`,
|
|
119
|
+
mentions: [senderId]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return true;
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error('Error in handleTagDetection:', error.message, 'Line:', error.stack?.split('\n')[1]);
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Keep detectTagall for backward compatibility
|
|
131
|
+
async function detectTagall(sock, chatId, message, senderId) {
|
|
132
|
+
try {
|
|
133
|
+
if (!chatId.endsWith('@g.us')) return false;
|
|
134
|
+
|
|
135
|
+
const config = getGroupConfig(chatId, 'antitag');
|
|
136
|
+
if (!config || !config.enabled) return false;
|
|
137
|
+
|
|
138
|
+
const { isSenderAdmin, isBotAdmin } = await isAdmin(sock, chatId, senderId);
|
|
139
|
+
if (!isBotAdmin || isSenderAdmin || db.isSudo(senderId)) return false;
|
|
140
|
+
|
|
141
|
+
const mentions = message.message?.extendedTextMessage?.contextInfo?.mentionedJid || [];
|
|
142
|
+
|
|
143
|
+
if (mentions.length < 5) return false;
|
|
144
|
+
|
|
145
|
+
const botName = getBotName();
|
|
146
|
+
const userTag = `@${senderId.split("@")[0]}`;
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
await sock.sendMessage(chatId, {
|
|
150
|
+
delete: {
|
|
151
|
+
remoteJid: chatId,
|
|
152
|
+
fromMe: false,
|
|
153
|
+
id: message.key.id,
|
|
154
|
+
participant: senderId
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
} catch (e) {
|
|
158
|
+
console.error("[ANTITAG] Delete failed:", e.message);
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const stats = antitagStats.get(chatId) || { blocked: 0 };
|
|
163
|
+
stats.blocked++;
|
|
164
|
+
antitagStats.set(chatId, stats);
|
|
165
|
+
|
|
166
|
+
if (config.action === 'kick') {
|
|
167
|
+
await sock.sendMessage(chatId, {
|
|
168
|
+
text: `*${botName}*\n\n${userTag} kicked for mass tagging!`,
|
|
169
|
+
mentions: [senderId]
|
|
170
|
+
});
|
|
171
|
+
await sock.groupParticipantsUpdate(chatId, [senderId], 'remove');
|
|
172
|
+
} else {
|
|
173
|
+
await sock.sendMessage(chatId, {
|
|
174
|
+
text: `*${botName}*\n\n${userTag}, mass tagging is not allowed!`,
|
|
175
|
+
mentions: [senderId]
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return true;
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.error('Error in detectTagall:', error.message, 'Line:', error.stack?.split('\n')[1]);
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
module.exports = {
|
|
187
|
+
handleAntitagCommand,
|
|
188
|
+
handleTagDetection, // Added this for main file compatibility
|
|
189
|
+
detectTagall, // Keep for backward compatibility
|
|
190
|
+
antitagStats
|
|
191
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const { getGroupConfig, setGroupConfig, deleteGroupToggle } = require('../../Database/settingsStore');
|
|
2
|
+
const isAdmin = require('../../davelib/isAdmin');
|
|
3
|
+
const db = require('../../Database/database');
|
|
4
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
5
|
+
|
|
6
|
+
async function antivideoCommand(sock, chatId, userMessage, senderId, isSenderAdmin, message) {
|
|
7
|
+
try {
|
|
8
|
+
const fake = createFakeContact(senderId);
|
|
9
|
+
const botName = getBotName();
|
|
10
|
+
|
|
11
|
+
if (!isSenderAdmin && !message?.key?.fromMe && !db.isSudo(senderId)) {
|
|
12
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAdmin only command!` }, { quoted: fake });
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const args = userMessage.slice(11).toLowerCase().trim().split(' ');
|
|
17
|
+
const action = args[0];
|
|
18
|
+
|
|
19
|
+
if (!action) {
|
|
20
|
+
const config = getGroupConfig(chatId, 'antivideo') || { enabled: false };
|
|
21
|
+
const currentMode = config.enabled ? (config.action || 'delete') : 'off';
|
|
22
|
+
|
|
23
|
+
const usage = `*${botName} ANTI-VIDEO*\n\nCurrent Mode: ${currentMode.toUpperCase()}\n\n*Commands:*\n.antivideo off - Disable\n.antivideo delete - Delete video\n.antivideo warn - Delete + warn\n.antivideo kick - Delete + kick`;
|
|
24
|
+
|
|
25
|
+
await sock.sendMessage(chatId, { text: usage }, { quoted: fake });
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const validModes = ["off", "delete", "warn", "kick"];
|
|
30
|
+
|
|
31
|
+
if (!validModes.includes(action)) {
|
|
32
|
+
await sock.sendMessage(chatId, {
|
|
33
|
+
text: `*${botName}*\nInvalid mode! Use: off, delete, warn, kick`
|
|
34
|
+
}, { quoted: fake });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (action === 'off') {
|
|
39
|
+
deleteGroupToggle(chatId, 'antivideo');
|
|
40
|
+
await sock.sendMessage(chatId, {
|
|
41
|
+
text: `*${botName}*\nAnti-Video DISABLED`
|
|
42
|
+
}, { quoted: fake });
|
|
43
|
+
} else {
|
|
44
|
+
setGroupConfig(chatId, 'antivideo', { enabled: true, action: action });
|
|
45
|
+
await sock.sendMessage(chatId, {
|
|
46
|
+
text: `*${botName}*\nAnti-Video: ${action.toUpperCase()}`
|
|
47
|
+
}, { quoted: fake });
|
|
48
|
+
}
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error('Error in antivideo command:', error.message, 'Line:', error.stack?.split('\n')[1]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function handleVideoDetection(sock, chatId, message, senderId) {
|
|
55
|
+
try {
|
|
56
|
+
const isVideo = message.type === 'videoMessage' ||
|
|
57
|
+
(message.message && message.message.videoMessage);
|
|
58
|
+
|
|
59
|
+
if (!isVideo) return;
|
|
60
|
+
if (!chatId.endsWith('@g.us')) return;
|
|
61
|
+
|
|
62
|
+
const config = getGroupConfig(chatId, 'antivideo');
|
|
63
|
+
if (!config || !config.enabled) return;
|
|
64
|
+
|
|
65
|
+
const { isSenderAdmin, isBotAdmin } = await isAdmin(sock, chatId, senderId);
|
|
66
|
+
if (!isBotAdmin || isSenderAdmin || db.isSudo(senderId)) return;
|
|
67
|
+
|
|
68
|
+
const botName = getBotName();
|
|
69
|
+
const userTag = `@${senderId.split("@")[0]}`;
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
await sock.sendMessage(chatId, {
|
|
73
|
+
delete: {
|
|
74
|
+
remoteJid: chatId,
|
|
75
|
+
fromMe: false,
|
|
76
|
+
id: message.key.id,
|
|
77
|
+
participant: senderId
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.error("[ANTI-VIDEO] Delete failed:", e.message);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (config.action === 'kick') {
|
|
86
|
+
await sock.sendMessage(chatId, {
|
|
87
|
+
text: `*${botName}*\n\n${userTag} kicked for sending video.`,
|
|
88
|
+
mentions: [senderId]
|
|
89
|
+
});
|
|
90
|
+
await sock.groupParticipantsUpdate(chatId, [senderId], 'remove');
|
|
91
|
+
} else if (config.action === 'warn') {
|
|
92
|
+
await sock.sendMessage(chatId, {
|
|
93
|
+
text: `*${botName}*\n\n${userTag}, videos are not allowed!`,
|
|
94
|
+
mentions: [senderId]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
} catch (error) {
|
|
98
|
+
console.error('Error in handleVideoDetection:', error.message, 'Line:', error.stack?.split('\n')[1]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = {
|
|
103
|
+
antivideoCommand,
|
|
104
|
+
handleVideoDetection
|
|
105
|
+
};
|