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,69 @@
|
|
|
1
|
+
const isAdmin = require('../../davelib/isAdmin');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
async function hijackCommand(sock, chatId, message, senderId) {
|
|
4
|
+
try {
|
|
5
|
+
const fake = createFakeContact(message);
|
|
6
|
+
|
|
7
|
+
if (!message.key.fromMe) {
|
|
8
|
+
await sock.sendMessage(chatId, { text: '❌ This command is only available for the owner!' }, { quoted: fake });
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (!chatId.endsWith('@g.us')) {
|
|
13
|
+
await sock.sendMessage(chatId, { text: '❌ This command can only be used in groups!' }, { quoted: fake });
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const adminStatus = await isAdmin(sock, chatId, senderId);
|
|
18
|
+
if (!adminStatus.isBotAdmin) {
|
|
19
|
+
await sock.sendMessage(chatId, { text: '❌ Bot must be an admin to hijack the group!' }, { quoted: fake });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
await sock.sendMessage(chatId, { text: '🔄 Starting group hijack...' }, { quoted: fake });
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const groupMetadata = await sock.groupMetadata(chatId);
|
|
27
|
+
const participants = groupMetadata.participants;
|
|
28
|
+
const botId = sock.user.id.split(':')[0] + '@s.whatsapp.net';
|
|
29
|
+
|
|
30
|
+
const admins = participants.filter(p => p.admin === 'admin' || p.admin === 'superadmin');
|
|
31
|
+
const nonBotAdmins = admins.filter(a => a.id !== botId);
|
|
32
|
+
|
|
33
|
+
let demotedCount = 0;
|
|
34
|
+
for (const admin of nonBotAdmins) {
|
|
35
|
+
try {
|
|
36
|
+
await sock.groupParticipantsUpdate(chatId, [admin.id], 'demote');
|
|
37
|
+
demotedCount++;
|
|
38
|
+
console.log(`[HIJACK] Demoted ${admin.id}`);
|
|
39
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.log(`[HIJACK] Failed to demote ${admin.id}: ${e.message}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const ownerId = message.key.participant || senderId;
|
|
46
|
+
if (ownerId !== botId) {
|
|
47
|
+
try {
|
|
48
|
+
await sock.groupParticipantsUpdate(chatId, [ownerId], 'promote');
|
|
49
|
+
console.log(`[HIJACK] Promoted owner ${ownerId}`);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.log(`[HIJACK] Owner already admin or failed: ${e.message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
await sock.sendMessage(chatId, {
|
|
56
|
+
text: `*Group Hijack Complete*\n\nDemoted: ${demotedCount} admin(s)\nYou are now the only admin\n\nUse this power responsibly!`
|
|
57
|
+
}, { quoted: fake });
|
|
58
|
+
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error('Hijack operation error:', error);
|
|
61
|
+
await sock.sendMessage(chatId, { text: `❌ Hijack failed: ${error.message}` }, { quoted: fake });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error('Error in hijack command:', error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = hijackCommand;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
const { setMenuImage, getMenuImage, setMenuVideo, getMenuVideo } = require('../../davelib/botConfig');
|
|
3
|
+
const { getOwnerConfig, setOwnerConfig } = require('../../Database/settingsStore');
|
|
4
|
+
|
|
5
|
+
const MENU_STYLES = {
|
|
6
|
+
'1': 'Document (large thumbnail)',
|
|
7
|
+
'2': 'Plain Text',
|
|
8
|
+
'3': 'Text + Ad Reply',
|
|
9
|
+
'4': 'Image + Caption',
|
|
10
|
+
'5': 'Interactive Flow',
|
|
11
|
+
'6': 'Payment Style',
|
|
12
|
+
'7': 'Video/GIF + Caption',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const DEFAULT_SETTINGS = {
|
|
16
|
+
menuStyle: '1',
|
|
17
|
+
showMemory: true,
|
|
18
|
+
showUptime: true,
|
|
19
|
+
showProgressBar: true,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function loadSettings() {
|
|
23
|
+
try {
|
|
24
|
+
const config = getOwnerConfig('menuSettings');
|
|
25
|
+
if (config && typeof config === 'object') {
|
|
26
|
+
return { ...DEFAULT_SETTINGS, ...config };
|
|
27
|
+
}
|
|
28
|
+
} catch {}
|
|
29
|
+
return { ...DEFAULT_SETTINGS };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function saveSettings(settings) {
|
|
33
|
+
try {
|
|
34
|
+
setOwnerConfig('menuSettings', settings);
|
|
35
|
+
} catch {}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getMenuSettings() { return loadSettings(); }
|
|
39
|
+
function getMenuStyle() { return loadSettings().menuStyle; }
|
|
40
|
+
|
|
41
|
+
function setMenuStyle(style) {
|
|
42
|
+
if (!MENU_STYLES[style]) return false;
|
|
43
|
+
const s = loadSettings();
|
|
44
|
+
s.menuStyle = style;
|
|
45
|
+
saveSettings(s);
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function toggleMenuSetting(key) {
|
|
50
|
+
const s = loadSettings();
|
|
51
|
+
if (typeof s[key] !== 'boolean') return false;
|
|
52
|
+
s[key] = !s[key];
|
|
53
|
+
saveSettings(s);
|
|
54
|
+
return s[key];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function setMenuSettings(newSettings) {
|
|
58
|
+
const s = { ...loadSettings(), ...newSettings };
|
|
59
|
+
saveSettings(s);
|
|
60
|
+
return s;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function menuManageCommand(sock, chatId, message, args) {
|
|
64
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
65
|
+
const fakeContact = createFakeContact(senderId);
|
|
66
|
+
const botName = getBotName();
|
|
67
|
+
|
|
68
|
+
if (args.length === 0) {
|
|
69
|
+
const settings = getMenuSettings();
|
|
70
|
+
const currentImage = getMenuImage() || '(none)';
|
|
71
|
+
const currentVideo = getMenuVideo() || '(none)';
|
|
72
|
+
|
|
73
|
+
let msg = `╭─❖ *MENU SETTINGS* ❖─╮\n`;
|
|
74
|
+
msg += `│ Style : ${settings.menuStyle} — ${MENU_STYLES[settings.menuStyle]}\n`;
|
|
75
|
+
msg += `│ Memory : ${settings.showMemory ? 'ON' : 'OFF'}\n`;
|
|
76
|
+
msg += `│ Uptime : ${settings.showUptime ? 'ON' : 'OFF'}\n`;
|
|
77
|
+
msg += `│ Bar : ${settings.showProgressBar ? 'ON' : 'OFF'}\n`;
|
|
78
|
+
msg += `│ Image : ${currentImage.length > 30 ? currentImage.slice(0, 30) + '…' : currentImage}\n`;
|
|
79
|
+
msg += `│ Video : ${currentVideo.length > 30 ? currentVideo.slice(0, 30) + '…' : currentVideo}\n`;
|
|
80
|
+
msg += `╰─────────────────────╯\n\n`;
|
|
81
|
+
msg += `*Styles:*\n`;
|
|
82
|
+
for (const [k, v] of Object.entries(MENU_STYLES)) msg += `${k} › ${v}\n`;
|
|
83
|
+
msg += `\n*Commands:*\n`;
|
|
84
|
+
msg += `✧ .menuset style <1-7>\n`;
|
|
85
|
+
msg += `✧ .menuset memory\n`;
|
|
86
|
+
msg += `✧ .menuset uptime\n`;
|
|
87
|
+
msg += `✧ .menuset progress\n`;
|
|
88
|
+
msg += `✧ .menuset image <url>\n`;
|
|
89
|
+
msg += `✧ .menuset video <url>\n`;
|
|
90
|
+
msg += `✧ .menuset resetimage\n`;
|
|
91
|
+
msg += `✧ .menuset resetvideo`;
|
|
92
|
+
await sock.sendMessage(chatId, { text: msg }, { quoted: fakeContact });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const action = args[0].toLowerCase();
|
|
97
|
+
|
|
98
|
+
try {
|
|
99
|
+
if (action === 'style') {
|
|
100
|
+
const style = args[1];
|
|
101
|
+
if (!style || !MENU_STYLES[style]) {
|
|
102
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n❌ Use: .menuset style <1-7>` }, { quoted: fakeContact });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (setMenuStyle(style)) {
|
|
106
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n✅ Style ${style}: ${MENU_STYLES[style]}` }, { quoted: fakeContact });
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (action === 'image') {
|
|
112
|
+
const url = args[1];
|
|
113
|
+
if (!url) {
|
|
114
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n❌ Provide an image URL.\nUsage: .menuset image <url>` }, { quoted: fakeContact });
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
setMenuImage(url);
|
|
118
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n✅ Menu image set.` }, { quoted: fakeContact });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (action === 'video') {
|
|
123
|
+
const url = args[1];
|
|
124
|
+
if (!url) {
|
|
125
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n❌ Provide a video/GIF URL.\nUsage: .menuset video <url>` }, { quoted: fakeContact });
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
setMenuVideo(url);
|
|
129
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n✅ Menu video set. Use style 7 to activate it.` }, { quoted: fakeContact });
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (action === 'resetimage') {
|
|
134
|
+
setMenuImage('');
|
|
135
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n✅ Menu image cleared.` }, { quoted: fakeContact });
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (action === 'resetvideo') {
|
|
140
|
+
setMenuVideo('');
|
|
141
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n✅ Menu video cleared.` }, { quoted: fakeContact });
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const toggleMap = {
|
|
146
|
+
'memory': 'showMemory',
|
|
147
|
+
'uptime': 'showUptime',
|
|
148
|
+
'progress': 'showProgressBar',
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const settingKey = toggleMap[action];
|
|
152
|
+
if (settingKey) {
|
|
153
|
+
const newVal = toggleMenuSetting(settingKey);
|
|
154
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n✅ ${action}: ${newVal ? 'ON' : 'OFF'}` }, { quoted: fakeContact });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n❌ Unknown option. Send .menuset to see all options.` }, { quoted: fakeContact });
|
|
159
|
+
|
|
160
|
+
} catch (err) {
|
|
161
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\n❌ Error: ${err.message}` }, { quoted: fakeContact });
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
module.exports = {
|
|
166
|
+
menuManageCommand,
|
|
167
|
+
MENU_STYLES,
|
|
168
|
+
getMenuSettings,
|
|
169
|
+
getMenuStyle,
|
|
170
|
+
setMenuStyle,
|
|
171
|
+
toggleMenuSetting,
|
|
172
|
+
setMenuSettings,
|
|
173
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./menuManage');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const settings = require('../../daveset');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
async function ownerCommand(sock, chatId, message) {
|
|
4
|
+
const fkontak = createFakeContact(message);
|
|
5
|
+
|
|
6
|
+
const vcard = `BEGIN:VCARD
|
|
7
|
+
VERSION:3.0
|
|
8
|
+
FN:${settings.botOwner}
|
|
9
|
+
TEL;waid=${settings.ownerNumber}:${settings.ownerNumber}
|
|
10
|
+
END:VCARD`;
|
|
11
|
+
|
|
12
|
+
await sock.sendMessage(chatId, {
|
|
13
|
+
contacts: { displayName: settings.botOwner, contacts: [{ vcard }] },
|
|
14
|
+
}, { quoted: fkontak });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = ownerCommand;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
const PastebinAPI = require('pastebin-js');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const pino = require('pino');
|
|
5
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
6
|
+
const db = require('../../Database/database');
|
|
7
|
+
const { makeid } = require('../../davelib/id');
|
|
8
|
+
const {
|
|
9
|
+
default: makeWASocket,
|
|
10
|
+
useMultiFileAuthState,
|
|
11
|
+
delay,
|
|
12
|
+
makeCacheableSignalKeyStore,
|
|
13
|
+
Browsers
|
|
14
|
+
} = require('@whiskeysockets/baileys');
|
|
15
|
+
|
|
16
|
+
const pastebin = new PastebinAPI('EMWTMkQAVfJa9kM-MRUrxd5Oku1U7pgL');
|
|
17
|
+
|
|
18
|
+
function removeFile(filePath) {
|
|
19
|
+
if (!fs.existsSync(filePath)) return false;
|
|
20
|
+
fs.rmSync(filePath, { recursive: true, force: true });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function isAuthorized(sock, message) {
|
|
24
|
+
try {
|
|
25
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
26
|
+
if (message.key.fromMe) return true;
|
|
27
|
+
return db.isSudo(senderId);
|
|
28
|
+
} catch {
|
|
29
|
+
return message.key.fromMe;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function pairCommand(sock, chatId, q, message) {
|
|
34
|
+
try {
|
|
35
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
36
|
+
const fake = createFakeContact(senderId);
|
|
37
|
+
const botName = getBotName();
|
|
38
|
+
|
|
39
|
+
if (!await isAuthorized(sock, message)) {
|
|
40
|
+
return sock.sendMessage(chatId, {
|
|
41
|
+
text: `*${botName}*\nOwner only command!`
|
|
42
|
+
}, { quoted: fake });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!q) {
|
|
46
|
+
return sock.sendMessage(chatId, {
|
|
47
|
+
text: `*${botName} PAIR*\n\n.pair 254712345678`
|
|
48
|
+
}, { quoted: fake });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const phoneNumber = q.replace(/[^0-9]/g, '');
|
|
52
|
+
|
|
53
|
+
if (phoneNumber.length < 10 || phoneNumber.length > 15) {
|
|
54
|
+
return sock.sendMessage(chatId, {
|
|
55
|
+
text: `*${botName}*\nInvalid number!`
|
|
56
|
+
}, { quoted: fake });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
await sock.sendMessage(chatId, {
|
|
60
|
+
text: `*${botName}*\nGenerating for +${phoneNumber}...`
|
|
61
|
+
}, { quoted: fake });
|
|
62
|
+
|
|
63
|
+
const id = makeid(10);
|
|
64
|
+
const tempDir = path.join(process.cwd(), 'temp', id);
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
await fs.promises.mkdir(tempDir, { recursive: true });
|
|
68
|
+
|
|
69
|
+
const { state, saveCreds } = await useMultiFileAuthState(tempDir);
|
|
70
|
+
|
|
71
|
+
const pairSock = makeWASocket({
|
|
72
|
+
auth: {
|
|
73
|
+
creds: state.creds,
|
|
74
|
+
keys: makeCacheableSignalKeyStore(state.keys, pino({ level: 'fatal' }).child({ level: 'fatal' })),
|
|
75
|
+
},
|
|
76
|
+
version: [2, 3000, 1027934701],
|
|
77
|
+
printQRInTerminal: false,
|
|
78
|
+
logger: pino({ level: 'fatal' }).child({ level: 'fatal' }),
|
|
79
|
+
browser: Browsers.macOS('Chrome')
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
if (!pairSock.authState.creds.registered) {
|
|
83
|
+
await delay(1500);
|
|
84
|
+
|
|
85
|
+
let code;
|
|
86
|
+
try {
|
|
87
|
+
code = await pairSock.requestPairingCode(phoneNumber);
|
|
88
|
+
} catch (pairErr) {
|
|
89
|
+
await delay(3000);
|
|
90
|
+
try {
|
|
91
|
+
code = await pairSock.requestPairingCode(phoneNumber);
|
|
92
|
+
} catch (retryErr) {
|
|
93
|
+
removeFile(tempDir);
|
|
94
|
+
return sock.sendMessage(chatId, {
|
|
95
|
+
text: `*${botName}*\nFailed to generate code.`
|
|
96
|
+
}, { quoted: fake });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const formattedCode = code?.match(/.{1,4}/g)?.join("-") || code;
|
|
101
|
+
|
|
102
|
+
// Optional: Save to pastebin
|
|
103
|
+
try {
|
|
104
|
+
await pastebin.createPaste({
|
|
105
|
+
text: `Pair code for ${phoneNumber}: ${formattedCode}`,
|
|
106
|
+
title: `Pair-${id}`,
|
|
107
|
+
format: 'text',
|
|
108
|
+
privacy: 1
|
|
109
|
+
});
|
|
110
|
+
} catch (pasteErr) {
|
|
111
|
+
console.log('Pastebin error:', pasteErr.message);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
await sock.sendMessage(chatId, {
|
|
115
|
+
text: `*${botName}*\nCode: ${formattedCode}\n\nEnter on target device.`
|
|
116
|
+
}, { quoted: fake });
|
|
117
|
+
|
|
118
|
+
pairSock.ev.on('creds.update', saveCreds);
|
|
119
|
+
|
|
120
|
+
pairSock.ev.on('connection.update', async (update) => {
|
|
121
|
+
const { connection } = update;
|
|
122
|
+
|
|
123
|
+
if (connection === 'open') {
|
|
124
|
+
await delay(5000);
|
|
125
|
+
|
|
126
|
+
const credsPath = path.join(tempDir, 'creds.json');
|
|
127
|
+
|
|
128
|
+
if (fs.existsSync(credsPath)) {
|
|
129
|
+
const data = fs.readFileSync(credsPath);
|
|
130
|
+
const b64data = Buffer.from(data).toString('base64');
|
|
131
|
+
const sessionId = `DAVE-X:~${b64data}`;
|
|
132
|
+
|
|
133
|
+
await pairSock.sendMessage(
|
|
134
|
+
pairSock.user.id,
|
|
135
|
+
{ text: sessionId }
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
await sock.sendMessage(chatId, {
|
|
139
|
+
text: `*${botName}*\nSession generated!\n\n${sessionId}`
|
|
140
|
+
}, { quoted: fake });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
await delay(100);
|
|
144
|
+
await pairSock.ws.close();
|
|
145
|
+
removeFile(tempDir);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
} catch (innerErr) {
|
|
151
|
+
console.error('Pair error:', innerErr.message);
|
|
152
|
+
removeFile(tempDir);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
} catch (error) {
|
|
156
|
+
console.error('Pair command error:', error.message);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
module.exports = pairCommand;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
|
|
3
|
+
async function pinchatCommand(sock, chatId, message, args) {
|
|
4
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
5
|
+
const fake = createFakeContact(senderId);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
|
|
8
|
+
if (!message.key.fromMe) {
|
|
9
|
+
await sock.sendMessage(chatId, {
|
|
10
|
+
text: `*${botName}*\n❌ Only the bot owner can pin chats.`
|
|
11
|
+
}, { quoted: fake });
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const sub = args[0]?.toLowerCase();
|
|
16
|
+
const target = args[1] || chatId;
|
|
17
|
+
const jid = target.includes('@') ? target : `${target.replace(/[^0-9]/g, '')}@s.whatsapp.net`;
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
await sock.sendMessage(chatId, { react: { text: '⏳', key: message.key } });
|
|
21
|
+
|
|
22
|
+
if (sub === 'off' || sub === 'unpin' || sub === 'remove') {
|
|
23
|
+
await sock.chatModify({ pin: false }, jid);
|
|
24
|
+
await sock.sendMessage(chatId, {
|
|
25
|
+
text: `*${botName}*\n✅ Chat unpinned.`
|
|
26
|
+
}, { quoted: fake });
|
|
27
|
+
} else {
|
|
28
|
+
await sock.chatModify({ pin: true }, jid);
|
|
29
|
+
await sock.sendMessage(chatId, {
|
|
30
|
+
text: `*${botName}*\n✅ Chat pinned to top.`
|
|
31
|
+
}, { quoted: fake });
|
|
32
|
+
}
|
|
33
|
+
} catch (e) {
|
|
34
|
+
await sock.sendMessage(chatId, {
|
|
35
|
+
text: `*${botName}*\n❌ Failed: ${e.message}`
|
|
36
|
+
}, { quoted: fake });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function unpinchatCommand(sock, chatId, message, args) {
|
|
41
|
+
return pinchatCommand(sock, chatId, message, ['off', ...(args || [])]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
module.exports = { pinchatCommand, unpinchatCommand };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
|
|
3
|
+
async function pingCommand(sock, chatId, message) {
|
|
4
|
+
const fake = createFakeContact(message);
|
|
5
|
+
const botName = getBotName();
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
await sock.sendMessage(chatId, {
|
|
9
|
+
react: { text: '⏳', key: message.key }
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const start = Date.now();
|
|
13
|
+
const sentMsg = await sock.sendMessage(chatId, {
|
|
14
|
+
text: `✦ *${botName}* | checking speed...`
|
|
15
|
+
}, { quoted: fake });
|
|
16
|
+
|
|
17
|
+
const ping = Date.now() - start;
|
|
18
|
+
|
|
19
|
+
// Generate highly accurate and detailed 3-decimal ping
|
|
20
|
+
const detailedPing = generatePrecisePing(ping);
|
|
21
|
+
|
|
22
|
+
const response = `✦ *${botName}* | ${detailedPing}ms`;
|
|
23
|
+
|
|
24
|
+
await sock.sendMessage(chatId, {
|
|
25
|
+
text: response,
|
|
26
|
+
edit: sentMsg.key // Edit the original message
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
await sock.sendMessage(chatId, {
|
|
30
|
+
react: { text: '✅', key: message.key }
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error('Ping error:', error);
|
|
35
|
+
await sock.sendMessage(chatId, {
|
|
36
|
+
text: `✦ *${botName}* | Failed to measure speed.`
|
|
37
|
+
}, { quoted: fake });
|
|
38
|
+
|
|
39
|
+
await sock.sendMessage(chatId, {
|
|
40
|
+
react: { text: '❌', key: message.key }
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Generate highly accurate and detailed 3-decimal ping value
|
|
47
|
+
* @param {number} ping - Original ping value
|
|
48
|
+
* @returns {string} Precise 3-decimal ping value
|
|
49
|
+
*/
|
|
50
|
+
function generatePrecisePing(ping) {
|
|
51
|
+
// Use performance.now() for microsecond precision if available
|
|
52
|
+
const performance = global.performance || {};
|
|
53
|
+
const microTime = typeof performance.now === 'function' ? performance.now() : ping;
|
|
54
|
+
|
|
55
|
+
// Calculate micro-precision offset (0.001 to 0.999 range)
|
|
56
|
+
const microOffset = (microTime % 1).toFixed(6);
|
|
57
|
+
const calculatedOffset = parseFloat(microOffset) * 0.999;
|
|
58
|
+
|
|
59
|
+
// Combine with original ping and ensure 3 decimal precision
|
|
60
|
+
const precisePing = (ping + calculatedOffset).toFixed(3);
|
|
61
|
+
|
|
62
|
+
return precisePing;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = pingCommand;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
|
|
3
|
+
async function removeProfilePicCommand(sock, chatId, message) {
|
|
4
|
+
const fake = createFakeContact(message);
|
|
5
|
+
const botName = getBotName();
|
|
6
|
+
try {
|
|
7
|
+
if (!message.key.fromMe) {
|
|
8
|
+
return sock.sendMessage(chatId, {
|
|
9
|
+
text: `✦ *${botName}* | Owner only command.`
|
|
10
|
+
}, { quoted: fake });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
await sock.removeProfilePicture(sock.user.id);
|
|
14
|
+
|
|
15
|
+
await sock.sendMessage(chatId, {
|
|
16
|
+
text: `✦ *${botName}* | ✅ Profile picture removed.`
|
|
17
|
+
}, { quoted: fake });
|
|
18
|
+
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error('removeProfilePicCommand error:', error.message);
|
|
21
|
+
await sock.sendMessage(chatId, {
|
|
22
|
+
text: `✦ *${botName}* | ❌ Failed to remove profile picture: ${error.message}`
|
|
23
|
+
}, { quoted: fake });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function setProfilePicPrivacyCommand(sock, chatId, message, mode) {
|
|
28
|
+
const fake = createFakeContact(message);
|
|
29
|
+
const botName = getBotName();
|
|
30
|
+
try {
|
|
31
|
+
if (!message.key.fromMe) {
|
|
32
|
+
return sock.sendMessage(chatId, {
|
|
33
|
+
text: `✦ *${botName}* | Owner only command.`
|
|
34
|
+
}, { quoted: fake });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// mode: 'all' = everyone, 'none' = nobody, 'contacts' = contacts only
|
|
38
|
+
await sock.updateProfilePicturePrivacy(mode);
|
|
39
|
+
|
|
40
|
+
const labels = { all: 'Everyone', none: 'Nobody', contacts: 'Contacts only' };
|
|
41
|
+
await sock.sendMessage(chatId, {
|
|
42
|
+
text: `✦ *${botName}* | ✅ Profile picture visibility set to *${labels[mode] || mode}*.`
|
|
43
|
+
}, { quoted: fake });
|
|
44
|
+
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error('setProfilePicPrivacyCommand error:', error.message);
|
|
47
|
+
|
|
48
|
+
let hint = '';
|
|
49
|
+
if (error.message?.includes('not-found') || error.message?.includes('conflict')) {
|
|
50
|
+
hint = '\n\n_Note: Try setting this from WhatsApp Settings > Privacy > Profile Photo._';
|
|
51
|
+
}
|
|
52
|
+
await sock.sendMessage(chatId, {
|
|
53
|
+
text: `✦ *${botName}* | ❌ Failed to update privacy: ${error.message}${hint}`
|
|
54
|
+
}, { quoted: fake });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
removeProfilePicCommand,
|
|
60
|
+
setProfilePicPrivacyCommand
|
|
61
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
const { setMenuImage } = require('../../davelib/botConfig');
|
|
3
|
+
|
|
4
|
+
async function resetMenuImageCommand(sock, chatId, message) {
|
|
5
|
+
const fakeContact = createFakeContact(message);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
setMenuImage('');
|
|
10
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nMenu image has been reset to default.` }, { quoted: fakeContact });
|
|
11
|
+
} catch (err) {
|
|
12
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nFailed to reset: ${err.message}` }, { quoted: fakeContact });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = resetMenuImageCommand;
|