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,133 @@
|
|
|
1
|
+
const { igdl } = require("ruhend-scraper");
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
// Store processed message IDs to prevent duplicates
|
|
5
|
+
const processedMessages = new Set();
|
|
6
|
+
|
|
7
|
+
// Fake contact creator 😜
|
|
8
|
+
// Function to extract unique media URLs with simple deduplication
|
|
9
|
+
function extractUniqueMedia(mediaData) {
|
|
10
|
+
const uniqueMedia = [];
|
|
11
|
+
const seenUrls = new Set();
|
|
12
|
+
|
|
13
|
+
for (const media of mediaData) {
|
|
14
|
+
if (!media.url) continue;
|
|
15
|
+
|
|
16
|
+
// Only check for exact URL duplicates
|
|
17
|
+
if (!seenUrls.has(media.url)) {
|
|
18
|
+
seenUrls.add(media.url);
|
|
19
|
+
uniqueMedia.push(media);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return uniqueMedia;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function instagramCommand(sock, chatId, message) {
|
|
27
|
+
const fkontak = createFakeContact(message);
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
// Check if message has already been processed
|
|
31
|
+
if (processedMessages.has(message.key.id)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Add message ID to processed set
|
|
36
|
+
processedMessages.add(message.key.id);
|
|
37
|
+
|
|
38
|
+
// Clean up old message IDs after 5 minutes
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
processedMessages.delete(message.key.id);
|
|
41
|
+
}, 5 * 60 * 1000);
|
|
42
|
+
|
|
43
|
+
const text = message.message?.conversation || message.message?.extendedTextMessage?.text;
|
|
44
|
+
|
|
45
|
+
if (!text) {
|
|
46
|
+
return await sock.sendMessage(chatId, {
|
|
47
|
+
text: "Please provide an Instagram link."
|
|
48
|
+
}, { quoted: fkontak });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Check for various Instagram URL formats
|
|
52
|
+
const instagramPatterns = [
|
|
53
|
+
/https?:\/\/(?:www\.)?instagram\.com\//,
|
|
54
|
+
/https?:\/\/(?:www\.)?instagr\.am\//
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const isValidUrl = instagramPatterns.some(pattern => pattern.test(text));
|
|
58
|
+
|
|
59
|
+
if (!isValidUrl) {
|
|
60
|
+
return await sock.sendMessage(chatId, {
|
|
61
|
+
text: "Please provide a valid Instagram link."
|
|
62
|
+
}, { quoted: fkontak });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
await sock.sendMessage(chatId, {
|
|
66
|
+
react: { text: '📥', key: message.key }
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const downloadData = await igdl(text);
|
|
70
|
+
|
|
71
|
+
if (!downloadData || !downloadData.data || downloadData.data.length === 0) {
|
|
72
|
+
return await sock.sendMessage(chatId, {
|
|
73
|
+
text: "No media found. The post might be private or link is invalid."
|
|
74
|
+
}, { quoted: fkontak });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const mediaData = downloadData.data;
|
|
78
|
+
|
|
79
|
+
// Simple deduplication - just remove exact URL duplicates
|
|
80
|
+
const uniqueMedia = extractUniqueMedia(mediaData);
|
|
81
|
+
|
|
82
|
+
// Limit to maximum 20 unique media items
|
|
83
|
+
const mediaToDownload = uniqueMedia.slice(0, 20);
|
|
84
|
+
|
|
85
|
+
if (mediaToDownload.length === 0) {
|
|
86
|
+
return await sock.sendMessage(chatId, {
|
|
87
|
+
text: "No valid media found to download."
|
|
88
|
+
}, { quoted: fkontak });
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Download all media
|
|
92
|
+
for (let i = 0; i < mediaToDownload.length; i++) {
|
|
93
|
+
try {
|
|
94
|
+
const media = mediaToDownload[i];
|
|
95
|
+
const mediaUrl = media.url;
|
|
96
|
+
|
|
97
|
+
// Check if URL ends with common video extensions
|
|
98
|
+
const isVideo = /\.(mp4|mov|avi|mkv|webm)$/i.test(mediaUrl) ||
|
|
99
|
+
media.type === 'video' ||
|
|
100
|
+
text.includes('/reel/') ||
|
|
101
|
+
text.includes('/tv/');
|
|
102
|
+
|
|
103
|
+
if (isVideo) {
|
|
104
|
+
await sock.sendMessage(chatId, {
|
|
105
|
+
video: { url: mediaUrl },
|
|
106
|
+
mimetype: "video/mp4"
|
|
107
|
+
}, { quoted: fkontak });
|
|
108
|
+
} else {
|
|
109
|
+
await sock.sendMessage(chatId, {
|
|
110
|
+
image: { url: mediaUrl }
|
|
111
|
+
}, { quoted: fkontak });
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Add small delay between downloads
|
|
115
|
+
if (i < mediaToDownload.length - 1) {
|
|
116
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
} catch (mediaError) {
|
|
120
|
+
console.error(`Error downloading media ${i + 1}:`, mediaError);
|
|
121
|
+
// Continue with next media if one fails
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.error('Error in Instagram command:', error);
|
|
127
|
+
await sock.sendMessage(chatId, {
|
|
128
|
+
text: "Error processing Instagram request. Please try again."
|
|
129
|
+
}, { quoted: fkontak });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
module.exports = instagramCommand;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
4
|
+
|
|
5
|
+
const MIME_MAP = {
|
|
6
|
+
'zip': 'application/zip',
|
|
7
|
+
'rar': 'application/x-rar-compressed',
|
|
8
|
+
'7z': 'application/x-7z-compressed',
|
|
9
|
+
'tar': 'application/x-tar',
|
|
10
|
+
'gz': 'application/gzip',
|
|
11
|
+
'pdf': 'application/pdf',
|
|
12
|
+
'doc': 'application/msword',
|
|
13
|
+
'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
14
|
+
'xls': 'application/vnd.ms-excel',
|
|
15
|
+
'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
16
|
+
'ppt': 'application/vnd.ms-powerpoint',
|
|
17
|
+
'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
18
|
+
'txt': 'text/plain',
|
|
19
|
+
'csv': 'text/csv',
|
|
20
|
+
'json': 'application/json',
|
|
21
|
+
'xml': 'application/xml',
|
|
22
|
+
'html': 'text/html',
|
|
23
|
+
'css': 'text/css',
|
|
24
|
+
'js': 'application/javascript',
|
|
25
|
+
'py': 'text/x-python',
|
|
26
|
+
'java': 'text/x-java-source',
|
|
27
|
+
'cpp': 'text/x-c++src',
|
|
28
|
+
'c': 'text/x-csrc',
|
|
29
|
+
'h': 'text/x-chdr',
|
|
30
|
+
'mp3': 'audio/mpeg',
|
|
31
|
+
'wav': 'audio/wav',
|
|
32
|
+
'ogg': 'audio/ogg',
|
|
33
|
+
'flac': 'audio/flac',
|
|
34
|
+
'aac': 'audio/aac',
|
|
35
|
+
'mp4': 'video/mp4',
|
|
36
|
+
'mkv': 'video/x-matroska',
|
|
37
|
+
'avi': 'video/x-msvideo',
|
|
38
|
+
'mov': 'video/quicktime',
|
|
39
|
+
'wmv': 'video/x-ms-wmv',
|
|
40
|
+
'flv': 'video/x-flv',
|
|
41
|
+
'webm': 'video/webm',
|
|
42
|
+
'jpg': 'image/jpeg',
|
|
43
|
+
'jpeg': 'image/jpeg',
|
|
44
|
+
'png': 'image/png',
|
|
45
|
+
'gif': 'image/gif',
|
|
46
|
+
'bmp': 'image/bmp',
|
|
47
|
+
'svg': 'image/svg+xml',
|
|
48
|
+
'webp': 'image/webp',
|
|
49
|
+
'ico': 'image/x-icon',
|
|
50
|
+
'apk': 'application/vnd.android.package-archive',
|
|
51
|
+
'exe': 'application/x-msdownload',
|
|
52
|
+
'dmg': 'application/x-apple-diskimage',
|
|
53
|
+
'iso': 'application/x-iso9660-image',
|
|
54
|
+
'deb': 'application/x-deb',
|
|
55
|
+
'rpm': 'application/x-rpm',
|
|
56
|
+
'ttf': 'font/ttf',
|
|
57
|
+
'otf': 'font/otf',
|
|
58
|
+
'woff': 'font/woff',
|
|
59
|
+
'woff2': 'font/woff2',
|
|
60
|
+
'sql': 'application/sql',
|
|
61
|
+
'db': 'application/x-sqlite3',
|
|
62
|
+
'psd': 'image/vnd.adobe.photoshop',
|
|
63
|
+
'ai': 'application/postscript',
|
|
64
|
+
'eps': 'application/postscript',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
function getMimeType(ext) {
|
|
68
|
+
if (!ext) return 'application/octet-stream';
|
|
69
|
+
return MIME_MAP[ext.toLowerCase()] || 'application/octet-stream';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function MediaFire(url, options) {
|
|
73
|
+
try {
|
|
74
|
+
options = options || {};
|
|
75
|
+
const res = await axios.get(url, { ...options, timeout: 15000 });
|
|
76
|
+
const $ = cheerio.load(res.data);
|
|
77
|
+
const link = $('a#downloadButton').attr('href');
|
|
78
|
+
const size = $('a#downloadButton').text().replace('Download', '').replace('(', '').replace(')', '').replace(/\n/g, '').trim();
|
|
79
|
+
const seplit = link.split('/');
|
|
80
|
+
const nama = seplit[5];
|
|
81
|
+
const ext = nama.split('.').pop();
|
|
82
|
+
return [{ nama, ext, size, link }];
|
|
83
|
+
} catch (err) {
|
|
84
|
+
return err;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function mediafireCommand(sock, chatId, message) {
|
|
89
|
+
const fake = createFakeContact(message);
|
|
90
|
+
const botName = getBotName();
|
|
91
|
+
|
|
92
|
+
const text = message.message?.conversation ||
|
|
93
|
+
message.message?.extendedTextMessage?.text || '';
|
|
94
|
+
|
|
95
|
+
const query = text.split(' ').slice(1).join(' ').trim();
|
|
96
|
+
|
|
97
|
+
if (!query) {
|
|
98
|
+
return sock.sendMessage(chatId, {
|
|
99
|
+
text: `*${botName}*\nUsage: .mediafire <link>\nExample: .mediafire https://www.mediafire.com/file/abc123/file.zip`
|
|
100
|
+
}, { quoted: fake });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (!query.includes('mediafire.com')) {
|
|
104
|
+
return sock.sendMessage(chatId, {
|
|
105
|
+
text: `*${botName}*\nThat doesn't look like a MediaFire link.`
|
|
106
|
+
}, { quoted: fake });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
await sock.sendMessage(chatId, {
|
|
111
|
+
text: `*${botName}*\nDownloading from MediaFire...`
|
|
112
|
+
}, { quoted: fake });
|
|
113
|
+
|
|
114
|
+
const fileInfo = await MediaFire(query);
|
|
115
|
+
|
|
116
|
+
if (!fileInfo || !fileInfo.length || fileInfo instanceof Error) {
|
|
117
|
+
return sock.sendMessage(chatId, {
|
|
118
|
+
text: `*${botName}*\nFailed to download. File may have been removed or link is invalid.`
|
|
119
|
+
}, { quoted: fake });
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const info = fileInfo[0];
|
|
123
|
+
const mimetype = getMimeType(info.ext);
|
|
124
|
+
|
|
125
|
+
await sock.sendMessage(
|
|
126
|
+
chatId,
|
|
127
|
+
{
|
|
128
|
+
document: { url: info.link },
|
|
129
|
+
fileName: info.nama,
|
|
130
|
+
mimetype: mimetype,
|
|
131
|
+
caption: `*${botName} MediaFire*\n\nFile: ${info.nama}\nSize: ${info.size}\nType: ${info.ext || 'Unknown'}`,
|
|
132
|
+
},
|
|
133
|
+
{ quoted: fake }
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.error("MediaFire Error:", error);
|
|
138
|
+
await sock.sendMessage(chatId, {
|
|
139
|
+
text: `*${botName}*\nFailed to download: ${error.message}`
|
|
140
|
+
}, { quoted: fake });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
module.exports = mediafireCommand;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
const axios = require('axios');
|
|
3
|
+
|
|
4
|
+
async function pinterestCommand(sock, chatId, message, args) {
|
|
5
|
+
const fakeContact = createFakeContact(message);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
const query = args.join(' ').trim();
|
|
8
|
+
|
|
9
|
+
if (!query) {
|
|
10
|
+
return sock.sendMessage(chatId, { text: `*${botName} PINTEREST*\n\nUsage: .pinterest <search>\nExample: .pinterest anime wallpaper` }, { quoted: fakeContact });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
await sock.sendMessage(chatId, { react: { text: '📌', key: message.key } });
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const res = await axios.get(`https://bk9.fun/search/pinterest?q=${encodeURIComponent(query)}`, { timeout: 15000 });
|
|
17
|
+
const images = res.data?.BK9 || res.data?.result;
|
|
18
|
+
|
|
19
|
+
if (images && Array.isArray(images) && images.length > 0) {
|
|
20
|
+
const selected = images.slice(0, 5);
|
|
21
|
+
for (const img of selected) {
|
|
22
|
+
const imgUrl = typeof img === 'string' ? img : img.url || img.image;
|
|
23
|
+
if (imgUrl) {
|
|
24
|
+
try {
|
|
25
|
+
await sock.sendMessage(chatId, { image: { url: imgUrl }, caption: `*${botName} Pinterest*\nSearch: ${query}` }, { quoted: fakeContact });
|
|
26
|
+
} catch {}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
30
|
+
} else {
|
|
31
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nNo images found for "${query}"` }, { quoted: fakeContact });
|
|
32
|
+
}
|
|
33
|
+
} catch (err) {
|
|
34
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nError: ${err.message}` }, { quoted: fakeContact });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = pinterestCommand;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const axios = require('axios');
|
|
3
|
+
const yts = require('yt-search');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
6
|
+
|
|
7
|
+
const AXIOS_DEFAULTS = {
|
|
8
|
+
timeout: 60000,
|
|
9
|
+
headers: {
|
|
10
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
|
11
|
+
'Accept': 'application/json, text/plain, */*'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
async function tryRequest(getter, attempts = 2) {
|
|
16
|
+
let lastError;
|
|
17
|
+
for (let i = 1; i <= attempts; i++) {
|
|
18
|
+
try {
|
|
19
|
+
return await getter();
|
|
20
|
+
} catch (err) {
|
|
21
|
+
lastError = err;
|
|
22
|
+
if (i < attempts) await new Promise(r => setTimeout(r, 1500));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
throw lastError;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function getAudioDownload(youtubeUrl) {
|
|
29
|
+
const apis = [
|
|
30
|
+
`https://apiskeith.top/download/audio?url=${encodeURIComponent(youtubeUrl)}`,
|
|
31
|
+
`https://apiskeith.top/download/ytmp3?url=${encodeURIComponent(youtubeUrl)}`,
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
let lastError;
|
|
35
|
+
for (const apiUrl of apis) {
|
|
36
|
+
try {
|
|
37
|
+
const res = await tryRequest(() => axios.get(apiUrl, AXIOS_DEFAULTS));
|
|
38
|
+
if (!res?.data) continue;
|
|
39
|
+
|
|
40
|
+
const data = res.data;
|
|
41
|
+
const result = data.result || data;
|
|
42
|
+
const url = (typeof result === 'string' && result.startsWith('http')) ? result :
|
|
43
|
+
result?.download || result?.url || result?.downloadUrl || result?.link || null;
|
|
44
|
+
|
|
45
|
+
if (url) {
|
|
46
|
+
return {
|
|
47
|
+
download: url,
|
|
48
|
+
title: result?.title || data?.title || 'YouTube Audio'
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
} catch (err) {
|
|
52
|
+
lastError = err;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
throw lastError || new Error('All audio APIs failed');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function playCommand(sock, chatId, message) {
|
|
60
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
61
|
+
const fake = createFakeContact(senderId);
|
|
62
|
+
const botName = getBotName();
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
await sock.sendMessage(chatId, { react: { text: '⏳', key: message.key } });
|
|
66
|
+
|
|
67
|
+
const tempDir = path.join(process.cwd(), 'tmp');
|
|
68
|
+
if (!fs.existsSync(tempDir)) fs.mkdirSync(tempDir, { recursive: true });
|
|
69
|
+
|
|
70
|
+
const text = message.message?.conversation ||
|
|
71
|
+
message.message?.extendedTextMessage?.text || '';
|
|
72
|
+
const parts = text.split(' ');
|
|
73
|
+
const query = parts.slice(1).join(' ').trim();
|
|
74
|
+
|
|
75
|
+
if (!query) {
|
|
76
|
+
return sock.sendMessage(chatId, {
|
|
77
|
+
text: `✦ *${botName}* Play\n\nUse: .play <song name>\nExample: .play Never Gonna Give You Up`
|
|
78
|
+
}, { quoted: fake });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (query.length > 100) {
|
|
82
|
+
return sock.sendMessage(chatId, {
|
|
83
|
+
text: `✦ *${botName}*\nSong name too long! Max 100 chars.`
|
|
84
|
+
}, { quoted: fake });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const search = await yts(`${query} official audio`);
|
|
88
|
+
const video = search.videos[0];
|
|
89
|
+
|
|
90
|
+
if (!video) {
|
|
91
|
+
return sock.sendMessage(chatId, {
|
|
92
|
+
text: `✦ *${botName}*\nCouldn't find that song. Try another one!`
|
|
93
|
+
}, { quoted: fake });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
await sock.sendMessage(chatId, {
|
|
97
|
+
text: `✦ *${botName}*\n\nTitle: ${video.title}\nDuration: ${video.timestamp}\nChannel: ${video.author?.name || 'Unknown'}\n\nDownloading...`
|
|
98
|
+
}, { quoted: fake });
|
|
99
|
+
|
|
100
|
+
const audio = await getAudioDownload(video.url);
|
|
101
|
+
const downloadUrl = audio.download;
|
|
102
|
+
const songTitle = audio.title || video.title;
|
|
103
|
+
|
|
104
|
+
const timestamp = Date.now();
|
|
105
|
+
const fileName = `audio_${timestamp}.mp3`;
|
|
106
|
+
const filePath = path.join(tempDir, fileName);
|
|
107
|
+
|
|
108
|
+
// Download with progress tracking disabled
|
|
109
|
+
const audioStream = await axios({
|
|
110
|
+
method: 'get',
|
|
111
|
+
url: downloadUrl,
|
|
112
|
+
responseType: 'stream',
|
|
113
|
+
timeout: 600000,
|
|
114
|
+
onDownloadProgress: null // Disable progress tracking
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const writer = fs.createWriteStream(filePath);
|
|
118
|
+
audioStream.data.pipe(writer);
|
|
119
|
+
|
|
120
|
+
await new Promise((resolve, reject) => {
|
|
121
|
+
writer.on('finish', resolve);
|
|
122
|
+
writer.on('error', reject);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
if (!fs.existsSync(filePath) || fs.statSync(filePath).size === 0) {
|
|
126
|
+
throw new Error('Download failed or empty file!');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Clean filename: remove special characters and limit length
|
|
130
|
+
const cleanTitle = songTitle
|
|
131
|
+
.replace(/[^\w\s-]/g, '') // Remove special chars
|
|
132
|
+
.replace(/\s+/g, ' ') // Normalize spaces
|
|
133
|
+
.trim()
|
|
134
|
+
.substring(0, 80); // Limit length
|
|
135
|
+
|
|
136
|
+
// Send as document with proper filename
|
|
137
|
+
await sock.sendMessage(chatId, {
|
|
138
|
+
document: fs.readFileSync(filePath),
|
|
139
|
+
mimetype: 'audio/mpeg',
|
|
140
|
+
fileName: `${cleanTitle}.mp3`
|
|
141
|
+
}, { quoted: fake });
|
|
142
|
+
|
|
143
|
+
// Cleanup
|
|
144
|
+
try { fs.unlinkSync(filePath); } catch (e) {}
|
|
145
|
+
|
|
146
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
147
|
+
|
|
148
|
+
} catch (error) {
|
|
149
|
+
console.error('Play command error:', error.message);
|
|
150
|
+
await sock.sendMessage(chatId, {
|
|
151
|
+
text: `✦ *${botName}*\nError: ${error.message}`
|
|
152
|
+
}, { quoted: fake });
|
|
153
|
+
|
|
154
|
+
await sock.sendMessage(chatId, { react: { text: '❌', key: message.key } });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
module.exports = playCommand;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const _0x3a2f8f=_0x207e;(function(_0x2b3b08,_0x3631dd){const _0x4da682=_0x207e,_0x3cf285=_0x2b3b08();while(!![]){try{const _0x31654c=parseInt(_0x4da682(0x134))/(-0x23ec+0x1*-0x20d2+0x44bf*0x1)*(parseInt(_0x4da682(0x178))/(0x26b*-0x7+0xdce+0x59*0x9))+-parseInt(_0x4da682(0x1a5))/(-0xf1*0xf+-0x5a9*0x1+-0x3*-0x699)*(parseInt(_0x4da682(0x138))/(0x25ca+-0x1fe9+0x4f*-0x13))+-parseInt(_0x4da682(0x12c))/(-0x1*-0x41b+-0x212*-0x2+-0x36*0x27)*(-parseInt(_0x4da682(0x14e))/(-0x1*-0xef7+-0x21ac+0x12bb))+parseInt(_0x4da682(0x1a7))/(0x240c+-0x1e89+-0x57c)*(parseInt(_0x4da682(0x1a9))/(-0x31*-0x1d+0x454+0x9d9*-0x1))+-parseInt(_0x4da682(0x13f))/(-0x122f+0x57e*-0x7+0x38aa)+-parseInt(_0x4da682(0x1ab))/(-0x8f3+-0xd17+0x6*0x3ae)*(parseInt(_0x4da682(0x164))/(0x3*-0x89c+0x3b7*0x3+-0x1a*-0x91))+-parseInt(_0x4da682(0x19d))/(-0x21*0x1b+-0x18e8+-0xfb*-0x1d)*(-parseInt(_0x4da682(0x194))/(-0x2*0xf89+-0x1137*-0x2+-0x34f));if(_0x31654c===_0x3631dd)break;else _0x3cf285['push'](_0x3cf285['shift']());}catch(_0x53b42d){_0x3cf285['push'](_0x3cf285['shift']());}}}(_0x5103,-0xd0d1*0xd+-0x2*0x73f61+0x20b671));const _0x1a5723=(function(){const _0x432376=_0x207e,_0x279a14={};_0x279a14[_0x432376(0x16e)]='\x4d\x4b\x49\x69\x73',_0x279a14[_0x432376(0x17a)]=_0x432376(0x12f),_0x279a14['\x48\x70\x66\x61\x4c']=function(_0x49ca55,_0x45fe0f){return _0x49ca55===_0x45fe0f;},_0x279a14[_0x432376(0x146)]=_0x432376(0x19a),_0x279a14[_0x432376(0x1a0)]=_0x432376(0x160);const _0x268203=_0x279a14;let _0x5150db=!![];return function(_0x49ee0f,_0x1f1bed){const _0x2f05d3=_0x432376,_0x382165={'\x4a\x77\x79\x75\x53':function(_0x4598ff,_0x1538ce){return _0x4598ff(_0x1538ce);},'\x71\x72\x61\x4c\x74':function(_0x5e77be,_0x2e49e5){return _0x5e77be(_0x2e49e5);},'\x54\x66\x43\x58\x63':function(_0x214688,_0x28960f){return _0x214688===_0x28960f;},'\x4a\x4c\x47\x74\x54':_0x268203['\x64\x49\x64\x48\x5a'],'\x79\x45\x63\x4b\x6c':_0x268203[_0x2f05d3(0x17a)],'\x50\x59\x61\x69\x4a':_0x2f05d3(0x16a)};if(_0x268203[_0x2f05d3(0x1bb)](_0x268203[_0x2f05d3(0x146)],_0x268203[_0x2f05d3(0x1a0)])){const _0x4c8028=_0x2b9317['\x61\x70\x70\x6c\x79'](_0x29ad9b,arguments);return _0x129e8f=null,_0x4c8028;}else{const _0x463abf=_0x5150db?function(){const _0x1b98ac=_0x2f05d3;if(_0x382165[_0x1b98ac(0x153)]('\x4d\x4b\x49\x69\x73',_0x382165[_0x1b98ac(0x13a)])){if(_0x1f1bed){if(_0x382165[_0x1b98ac(0x153)](_0x382165[_0x1b98ac(0x185)],_0x382165[_0x1b98ac(0x136)]))_0x382165[_0x1b98ac(0x1a4)](_0x1cc577,-0x1369+-0x1*-0x171f+-0xbe*0x5);else{const _0x23e80=_0x1f1bed[_0x1b98ac(0x162)](_0x49ee0f,arguments);return _0x1f1bed=null,_0x23e80;}}}else _0x382165[_0x1b98ac(0x148)](_0x273672,'\x30');}:function(){};return _0x5150db=![],_0x463abf;}};}()),_0x304a41=_0x1a5723(this,function(){const _0x512fde=_0x207e,_0x10c95b={};_0x10c95b[_0x512fde(0x186)]=_0x512fde(0x198);const _0x10e9ea=_0x10c95b;return _0x304a41[_0x512fde(0x197)]()[_0x512fde(0x144)](_0x10e9ea[_0x512fde(0x186)])[_0x512fde(0x197)]()[_0x512fde(0x14f)](_0x304a41)[_0x512fde(0x144)](_0x10e9ea[_0x512fde(0x186)]);});_0x304a41();const _0x16c7f2=(function(){const _0x3d3bec=_0x207e,_0x262661={};_0x262661[_0x3d3bec(0x15c)]=function(_0x366b54,_0xd3fca){return _0x366b54!==_0xd3fca;},_0x262661[_0x3d3bec(0x172)]='\x71\x4b\x72\x51\x68',_0x262661[_0x3d3bec(0x17b)]=_0x3d3bec(0x166),_0x262661[_0x3d3bec(0x169)]='\x63\x6f\x75\x6e\x74\x65\x72';const _0x3e55c5=_0x262661;let _0x53064e=!![];return function(_0x557198,_0x3dd6b0){const _0x245754=_0x3d3bec,_0x59489e={};_0x59489e['\x44\x4e\x6d\x75\x61']=_0x3e55c5[_0x245754(0x17b)],_0x59489e[_0x245754(0x1af)]=_0x3e55c5[_0x245754(0x169)];const _0x1a6f27=_0x59489e,_0x1a4f6f=_0x53064e?function(){const _0x21e0bb=_0x245754;if(_0x3e55c5[_0x21e0bb(0x15c)](_0x3e55c5[_0x21e0bb(0x172)],_0x3e55c5[_0x21e0bb(0x172)]))return function(_0x58aa3f){}[_0x21e0bb(0x14f)](_0x1a6f27['\x44\x4e\x6d\x75\x61'])[_0x21e0bb(0x162)](_0x1a6f27[_0x21e0bb(0x1af)]);else{if(_0x3dd6b0){const _0x1b4b07=_0x3dd6b0['\x61\x70\x70\x6c\x79'](_0x557198,arguments);return _0x3dd6b0=null,_0x1b4b07;}}}:function(){};return _0x53064e=![],_0x1a4f6f;};}());(function(){const _0x24d73d=_0x207e,_0x5d9d6e={'\x68\x75\x71\x6d\x42':_0x24d73d(0x198),'\x4f\x51\x51\x4e\x69':'\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x2a\x5c\x28\x20\x2a\x5c\x29','\x6b\x4b\x55\x76\x64':_0x24d73d(0x19b),'\x78\x4e\x62\x61\x76':function(_0x159979,_0x564d5a){return _0x159979(_0x564d5a);},'\x45\x70\x67\x4e\x73':function(_0x2c1b42,_0x44e5c6){return _0x2c1b42+_0x44e5c6;},'\x44\x5a\x56\x4d\x62':function(_0x5ee801,_0x8fe5cc){return _0x5ee801+_0x8fe5cc;},'\x73\x62\x69\x4a\x6e':function(_0x5ba502,_0x2e9b8c){return _0x5ba502(_0x2e9b8c);},'\x69\x63\x46\x65\x78':function(_0x38989e,_0x37baa7){return _0x38989e!==_0x37baa7;},'\x6a\x76\x6c\x75\x49':'\x45\x46\x67\x43\x70','\x66\x67\x45\x57\x78':function(_0x567a8b){return _0x567a8b();},'\x76\x68\x6d\x59\x4d':function(_0x3bbc15,_0x5a1d8d,_0x10119b){return _0x3bbc15(_0x5a1d8d,_0x10119b);}};_0x5d9d6e[_0x24d73d(0x174)](_0x16c7f2,this,function(){const _0x5c76a3=_0x24d73d,_0x45a4ba={};_0x45a4ba[_0x5c76a3(0x1b4)]=_0x5d9d6e[_0x5c76a3(0x188)];const _0x1195c9=_0x45a4ba,_0x1a0106=new RegExp(_0x5d9d6e['\x4f\x51\x51\x4e\x69']),_0x523bdd=new RegExp(_0x5d9d6e[_0x5c76a3(0x17f)],'\x69'),_0x337592=_0x5d9d6e['\x78\x4e\x62\x61\x76'](_0x22a846,_0x5c76a3(0x14a));if(!_0x1a0106[_0x5c76a3(0x1b9)](_0x5d9d6e[_0x5c76a3(0x15e)](_0x337592,_0x5c76a3(0x14c)))||!_0x523bdd[_0x5c76a3(0x1b9)](_0x5d9d6e[_0x5c76a3(0x175)](_0x337592,_0x5c76a3(0x18a))))_0x5d9d6e[_0x5c76a3(0x193)](_0x337592,'\x30');else{if(_0x5d9d6e[_0x5c76a3(0x1b5)](_0x5d9d6e[_0x5c76a3(0x12d)],_0x5c76a3(0x12b)))return _0x325eab[_0x5c76a3(0x197)]()[_0x5c76a3(0x144)](_0x1195c9[_0x5c76a3(0x1b4)])[_0x5c76a3(0x197)]()['\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72'](_0x241b34)['\x73\x65\x61\x72\x63\x68'](_0x5c76a3(0x198));else _0x5d9d6e['\x66\x67\x45\x57\x78'](_0x22a846);}})();}());const fs=require('\x66\x73'),path=require(_0x3a2f8f(0x19f)),{downloadMediaMessage}=require(_0x3a2f8f(0x145));function _0x5103(){const _0x132490=['\x41\x68\x76\x58\x42\x75\x69','\x7a\x68\x4c\x71\x72\x68\x69','\x41\x77\x35\x57\x44\x78\x71','\x43\x4d\x76\x48\x79\x33\x71','\x43\x4d\x76\x54\x42\x33\x72\x4c\x73\x4d\x4c\x4b','\x44\x75\x48\x74\x77\x66\x43','\x43\x33\x72\x59\x41\x77\x35\x4e','\x7a\x4e\x66\x7a\x79\x4b\x4b','\x7a\x4e\x76\x55\x79\x33\x72\x50\x42\x32\x34\x47\x6b\x4c\x57\x4f\x69\x63\x50\x43\x6b\x71','\x73\x78\x44\x76\x45\x65\x71','\x79\x32\x39\x55\x44\x67\x76\x34\x44\x65\x4c\x55\x7a\x4d\x38','\x43\x32\x6a\x50\x73\x4d\x34','\x6d\x4a\x61\x34\x72\x4b\x6e\x76\x76\x78\x6e\x57','\x43\x4d\x76\x31\x43\x67\x58\x56\x79\x77\x72\x73\x7a\x78\x66\x31\x7a\x78\x6e\x30','\x79\x32\x66\x53\x42\x61','\x44\x67\x39\x74\x44\x68\x6a\x50\x42\x4d\x43','\x6b\x63\x47\x4f\x6c\x49\x53\x50\x6b\x59\x4b\x52\x6b\x73\x53\x4b','\x72\x68\x6e\x6b\x44\x67\x4b','\x41\x4e\x50\x79\x43\x67\x69','\x78\x63\x54\x43\x6b\x59\x61\x51\x6b\x64\x38\x36\x77\x32\x65\x54\x45\x4b\x65\x54\x77\x4c\x38\x4b\x78\x76\x53\x57\x6c\x74\x4c\x48\x6c\x78\x50\x62\x6c\x76\x50\x46\x6a\x66\x30\x51\x6b\x71','\x43\x78\x6a\x51\x41\x4b\x57','\x6d\x4a\x71\x33\x6d\x74\x79\x30\x7a\x77\x66\x69\x73\x75\x66\x79','\x6d\x65\x62\x5a\x6c\x4e\x44\x4f\x79\x78\x72\x5a\x79\x78\x62\x57\x6c\x4d\x35\x4c\x44\x61','\x43\x67\x66\x30\x41\x61','\x44\x4d\x6e\x62\x42\x31\x4f','\x43\x33\x72\x48\x44\x67\x76\x70\x79\x4d\x50\x4c\x79\x33\x71','\x42\x67\x39\x4e\x7a\x32\x76\x59','\x76\x67\x44\x70\x73\x30\x4b','\x73\x4e\x44\x35\x44\x76\x6d','\x6d\x33\x6e\x6b\x76\x4d\x58\x57\x77\x47','\x72\x77\x58\x4c\x72\x66\x69','\x6e\x4a\x75\x58\x41\x4d\x66\x70\x71\x33\x62\x62','\x44\x4b\x6e\x58\x7a\x65\x65','\x6d\x74\x43\x59\x6d\x4a\x72\x32\x42\x31\x6e\x51\x79\x31\x47','\x76\x76\x62\x6a\x76\x30\x43','\x6e\x74\x69\x5a\x6d\x64\x69\x58\x6d\x67\x4c\x6d\x44\x4b\x44\x32\x43\x61','\x72\x4b\x76\x69\x43\x4d\x38','\x44\x65\x39\x71\x72\x4b\x75','\x75\x4c\x44\x62\x74\x31\x43','\x44\x65\x44\x4b\x45\x78\x69','\x75\x76\x7a\x35\x41\x78\x71','\x74\x31\x50\x51\x44\x76\x43','\x43\x67\x66\x59\x44\x67\x4c\x4a\x41\x78\x62\x48\x42\x4e\x71','\x72\x30\x66\x54\x43\x75\x47','\x41\x68\x6a\x48\x41\x4c\x43','\x41\x77\x6e\x67\x7a\x78\x47','\x42\x31\x44\x6d\x73\x31\x69','\x79\x4c\x62\x75\x76\x32\x71','\x44\x32\x7a\x32\x79\x4b\x47','\x44\x67\x76\x5a\x44\x61','\x79\x4e\x76\x4d\x7a\x4d\x76\x59','\x73\x68\x62\x4d\x79\x75\x57','\x42\x75\x7a\x74\x44\x67\x30','\x43\x67\x66\x59\x44\x67\x4c\x4a\x41\x78\x62\x48\x42\x4e\x72\x5a','\x72\x75\x7a\x4e\x71\x33\x61','\x6e\x64\x76\x50\x43\x68\x48\x33\x74\x78\x6d','\x41\x4e\x7a\x53\x44\x75\x4b','\x41\x66\x7a\x51\x42\x78\x65','\x72\x30\x48\x33\x44\x33\x69','\x7a\x78\x48\x30\x7a\x77\x35\x4b\x7a\x77\x72\x75\x7a\x78\x48\x30\x74\x77\x76\x5a\x43\x32\x66\x4e\x7a\x71','\x44\x4d\x48\x53\x77\x65\x6d','\x79\x32\x39\x31\x42\x4e\x72\x4c\x43\x47','\x7a\x67\x76\x49\x44\x71','\x6d\x74\x4b\x5a\x6d\x77\x50\x59\x76\x77\x66\x4f\x45\x61','\x71\x76\x50\x6b\x7a\x30\x47','\x75\x66\x4c\x48\x41\x75\x4f','\x75\x33\x72\x48\x44\x68\x76\x5a\x69\x67\x76\x59\x43\x4d\x39\x59\x6f\x47','\x6e\x74\x4b\x5a\x6e\x74\x71\x57\x43\x76\x66\x52\x73\x66\x48\x66','\x41\x77\x31\x48\x7a\x32\x76\x6e\x7a\x78\x6e\x5a\x79\x77\x44\x4c','\x73\x4b\x58\x68\x44\x66\x71','\x79\x77\x6e\x30\x41\x77\x39\x55','\x43\x4c\x72\x67\x43\x4b\x65','\x44\x67\x76\x34\x44\x61','\x79\x78\x76\x4b\x41\x77\x38','\x6d\x74\x43\x57\x6f\x74\x6d\x59\x6e\x78\x6a\x34\x45\x77\x66\x49\x41\x71','\x7a\x65\x76\x52\x43\x33\x6d','\x72\x4c\x48\x69\x74\x77\x57','\x44\x78\x6e\x4c\x43\x47','\x42\x65\x31\x6f\x79\x4e\x71','\x43\x32\x76\x48\x43\x4d\x6e\x4f','\x71\x68\x44\x4f\x41\x78\x6e\x52\x7a\x78\x4c\x5a\x42\x32\x6e\x52\x7a\x78\x72\x5a\x6c\x32\x6a\x48\x41\x77\x58\x4c\x45\x78\x6d','\x76\x67\x35\x6e\x44\x4e\x71','\x72\x65\x66\x77\x72\x73\x31\x79','\x43\x78\x6a\x48\x74\x68\x71','\x73\x66\x66\x78\x41\x77\x34','\x41\x77\x35\x50\x44\x61','\x42\x67\x76\x55\x7a\x33\x72\x4f','\x79\x32\x48\x48\x41\x77\x34','\x41\x4d\x35\x76\x79\x75\x71','\x6d\x5a\x61\x33\x6e\x5a\x4b\x30\x77\x78\x6a\x6d\x76\x4e\x4c\x53','\x79\x32\x39\x55\x43\x33\x72\x59\x44\x77\x6e\x30\x42\x33\x69','\x44\x33\x4c\x55\x45\x4b\x4f','\x43\x33\x62\x53\x41\x78\x71','\x7a\x32\x44\x4c\x43\x47','\x76\x67\x7a\x64\x77\x67\x6d','\x79\x78\x76\x4b\x41\x77\x39\x6e\x7a\x78\x6e\x5a\x79\x77\x44\x4c','\x43\x32\x76\x55\x7a\x65\x31\x4c\x43\x33\x6e\x48\x7a\x32\x75','\x43\x65\x76\x53\x41\x66\x61','\x42\x75\x50\x35\x71\x4c\x47','\x79\x75\x6e\x79\x74\x4b\x47','\x72\x4c\x72\x49\x43\x4e\x69','\x74\x33\x44\x55\x7a\x78\x69\x47\x42\x32\x35\x53\x45\x71','\x42\x77\x76\x5a\x43\x32\x66\x4e\x7a\x71','\x79\x4b\x31\x36\x76\x4b\x65','\x73\x66\x76\x4f\x71\x30\x71','\x72\x78\x62\x4e\x74\x4e\x6d','\x71\x4b\x76\x68\x73\x75\x34\x36\x76\x4b\x6e\x62\x75\x4b\x71\x6b\x76\x4b\x76\x73\x75\x30\x4c\x70\x74\x4a\x4f\x5a\x6c\x4a\x61\x6b\x74\x4a\x50\x65\x79\x78\x7a\x4c\x6c\x76\x47\x37\x6f\x5a\x53\x6b\x72\x4b\x34\x36\x72\x65\x66\x77\x72\x73\x31\x79\x63\x4c\x72\x66\x74\x64\x54\x33\x79\x77\x4c\x4b\x70\x71','\x74\x33\x6e\x36\x43\x78\x69','\x63\x4b\x76\x6f\x72\x64\x50\x77\x71\x30\x66\x73\x72\x61','\x79\x78\x62\x57\x42\x68\x4b','\x44\x65\x66\x5a\x71\x4b\x38','\x6d\x74\x66\x75\x75\x66\x4c\x4f\x72\x4b\x69','\x44\x30\x6a\x59\x75\x75\x71','\x44\x32\x48\x50\x42\x67\x75\x47\x6b\x68\x72\x59\x44\x77\x75\x50\x69\x68\x54\x39','\x74\x77\x66\x41\x77\x4d\x30','\x7a\x78\x44\x4b\x74\x31\x4b','\x71\x30\x31\x78\x74\x32\x6d','\x77\x4b\x58\x51\x74\x4b\x38','\x7a\x78\x76\x4d\x45\x4c\x47','\x44\x65\x58\x66\x7a\x33\x75','\x42\x67\x44\x6f\x71\x4d\x43','\x7a\x65\x4c\x4b\x73\x66\x4f','\x41\x4e\x50\x66\x77\x67\x79','\x7a\x4e\x6a\x56\x42\x75\x31\x4c','\x41\x30\x58\x32\x79\x31\x4f','\x74\x4c\x6a\x55\x44\x76\x4b','\x44\x65\x54\x6b\x44\x30\x47','\x44\x4d\x48\x54\x77\x75\x30','\x72\x66\x50\x77\x74\x77\x69','\x74\x4e\x4c\x55\x71\x33\x75','\x72\x65\x39\x69\x76\x65\x47','\x6d\x5a\x47\x59\x41\x32\x39\x57\x44\x4d\x48\x72','\x44\x78\x62\x4b\x79\x78\x72\x4c\x74\x77\x76\x4b\x41\x77\x66\x6e\x7a\x78\x6e\x5a\x79\x77\x44\x4c','\x76\x68\x6a\x71\x75\x4e\x65','\x43\x4d\x50\x65\x74\x76\x4b','\x44\x4d\x4c\x4b\x7a\x77\x38','\x43\x67\x6e\x63\x79\x30\x79','\x72\x4c\x44\x62\x41\x32\x71','\x41\x30\x54\x76\x44\x4d\x71','\x71\x68\x6d\x55\x44\x32\x48\x48\x44\x68\x6e\x48\x43\x68\x61\x55\x42\x4d\x76\x30','\x44\x4d\x4c\x4b\x7a\x77\x39\x6e\x7a\x78\x6e\x5a\x79\x77\x44\x4c','\x41\x32\x76\x35','\x72\x67\x50\x6b\x77\x65\x6d','\x77\x76\x62\x77\x44\x77\x69','\x45\x75\x76\x4a\x73\x32\x57','\x74\x67\x35\x64\x75\x68\x4b','\x74\x67\x54\x4a\x79\x30\x4b'];_0x5103=function(){return _0x132490;};return _0x5103();}
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
async function saveStatusCommand(_0x3f38b4,_0x348166,_0x5b03ef){const _0x59c3c8=_0x3a2f8f,_0x36a8aa={'\x77\x66\x76\x62\x48':function(_0x4c125d){return _0x4c125d();},'\x46\x57\x41\x6b\x64':function(_0xb7a49,_0x5e62d0){return _0xb7a49+_0x5e62d0;},'\x49\x65\x65\x4c\x6c':_0x59c3c8(0x133),'\x77\x42\x72\x51\x44':_0x59c3c8(0x1a1),'\x4d\x61\x5a\x5a\x6d':function(_0x5089c3,_0x58d5e5){return _0x5089c3===_0x58d5e5;},'\x4a\x55\x51\x63\x49':_0x59c3c8(0x15a),'\x44\x4f\x48\x54\x48':_0x59c3c8(0x1a3),'\x44\x58\x79\x59\x52':_0x59c3c8(0x180),'\x6a\x6e\x55\x61\x44':function(_0x242ece,_0x2f7514,_0x29cda0,_0x116f00,_0x513627){return _0x242ece(_0x2f7514,_0x29cda0,_0x116f00,_0x513627);},'\x70\x45\x6c\x68\x50':_0x59c3c8(0x1ba),'\x74\x54\x79\x5a\x6d':function(_0x4870f9,_0x291b27,_0x1680e4,_0x4f9f92,_0x133d00){return _0x4870f9(_0x291b27,_0x1680e4,_0x4f9f92,_0x133d00);},'\x71\x72\x6a\x6a\x4c':_0x59c3c8(0x176),'\x64\x45\x6b\x73\x73':_0x59c3c8(0x131),'\x64\x61\x4a\x4c\x52':_0x59c3c8(0x1a6),'\x6d\x4a\x79\x42\x58':_0x59c3c8(0x18f),'\x74\x41\x73\x42\x4f':_0x59c3c8(0x137)};try{const _0x234811=createFakeContact(_0x5b03ef);if(!_0x5b03ef[_0x59c3c8(0x182)][_0x59c3c8(0x170)]){if(_0x36a8aa[_0x59c3c8(0x167)](_0x59c3c8(0x15d),_0x59c3c8(0x15d))){const _0x22bb02={};_0x22bb02[_0x59c3c8(0x13d)]=_0x36a8aa['\x4a\x55\x51\x63\x49'];const _0xfe22dc={};return _0xfe22dc['\x71\x75\x6f\x74\x65\x64']=_0x234811,_0x3f38b4[_0x59c3c8(0x155)](_0x348166,_0x22bb02,_0xfe22dc);}else{const _0xbc053=_0x309978?function(){const _0xd8c950=_0x59c3c8;if(_0x2e2f31){const _0x3d52b6=_0x503dd1[_0xd8c950(0x162)](_0x42e6bc,arguments);return _0x538f9e=null,_0x3d52b6;}}:function(){};return _0x5906f8=![],_0xbc053;}}const _0x1b5204=_0x5b03ef['\x6d\x65\x73\x73\x61\x67\x65']?.['\x65\x78\x74\x65\x6e\x64\x65\x64\x54\x65\x78\x74\x4d\x65\x73\x73\x61\x67\x65']?.[_0x59c3c8(0x192)],_0x469179=_0x1b5204?.['\x71\x75\x6f\x74\x65\x64\x4d\x65\x73\x73\x61\x67\x65'];if(!_0x469179){if(_0x36a8aa['\x44\x4f\x48\x54\x48']!==_0x36a8aa[_0x59c3c8(0x177)]){const _0x3f7e5f=_0x2738bd['\x61\x70\x70\x6c\x79'](_0xa4972e,arguments);return _0x344ac1=null,_0x3f7e5f;}else{const _0x591810={};_0x591810['\x74\x65\x78\x74']='\u274c',_0x591810['\x6b\x65\x79']=_0x5b03ef['\x6b\x65\x79'];const _0x55cb70={};_0x55cb70[_0x59c3c8(0x18b)]=_0x591810,await _0x3f38b4['\x73\x65\x6e\x64\x4d\x65\x73\x73\x61\x67\x65'](_0x348166,_0x55cb70);return;}}const _0x33c4bb=_0x3f38b4[_0x59c3c8(0x142)]['\x69\x64'][_0x59c3c8(0x151)]('\x3a')[0x1d*-0xc2+-0x211*-0x4+0x75*0x1e]+_0x36a8aa['\x44\x58\x79\x59\x52'];if(_0x469179[_0x59c3c8(0x139)]){const _0x3c58ad={};_0x3c58ad['\x6d\x65\x73\x73\x61\x67\x65']=_0x469179;const _0x317896={};_0x317896[_0x59c3c8(0x1a2)]=_0x3f38b4['\x6c\x6f\x67\x67\x65\x72'],_0x317896['\x72\x65\x75\x70\x6c\x6f\x61\x64\x52\x65\x71\x75\x65\x73\x74']=_0x3f38b4[_0x59c3c8(0x179)];const _0x5b894f=await _0x36a8aa[_0x59c3c8(0x14d)](downloadMediaMessage,_0x3c58ad,_0x36a8aa[_0x59c3c8(0x156)],{},_0x317896),_0x594604={};_0x594604['\x69\x6d\x61\x67\x65']=_0x5b894f,await _0x3f38b4[_0x59c3c8(0x155)](_0x33c4bb,_0x594604);}else{if(_0x469179[_0x59c3c8(0x181)]){const _0x46b426={};_0x46b426[_0x59c3c8(0x15b)]=_0x469179;const _0x2957f2={};_0x2957f2['\x6c\x6f\x67\x67\x65\x72']=_0x3f38b4[_0x59c3c8(0x1a2)],_0x2957f2[_0x59c3c8(0x195)]=_0x3f38b4[_0x59c3c8(0x179)];const _0x29053a=await _0x36a8aa['\x74\x54\x79\x5a\x6d'](downloadMediaMessage,_0x46b426,_0x36a8aa[_0x59c3c8(0x156)],{},_0x2957f2),_0x50760d={};_0x50760d[_0x59c3c8(0x17c)]=_0x29053a,await _0x3f38b4[_0x59c3c8(0x155)](_0x33c4bb,_0x50760d);}else{if(_0x469179[_0x59c3c8(0x154)]){if(_0x36a8aa['\x4d\x61\x5a\x5a\x6d'](_0x36a8aa[_0x59c3c8(0x19c)],_0x36a8aa[_0x59c3c8(0x19c)])){const _0x5035e0={};_0x5035e0[_0x59c3c8(0x15b)]=_0x469179;const _0x4641b3={};_0x4641b3[_0x59c3c8(0x1a2)]=_0x3f38b4['\x6c\x6f\x67\x67\x65\x72'],_0x4641b3['\x72\x65\x75\x70\x6c\x6f\x61\x64\x52\x65\x71\x75\x65\x73\x74']=_0x3f38b4[_0x59c3c8(0x179)];const _0x5a9fed=await downloadMediaMessage(_0x5035e0,_0x36a8aa[_0x59c3c8(0x156)],{},_0x4641b3),_0x2c5b75={};_0x2c5b75[_0x59c3c8(0x13e)]=_0x5a9fed,await _0x3f38b4['\x73\x65\x6e\x64\x4d\x65\x73\x73\x61\x67\x65'](_0x33c4bb,_0x2c5b75);}else GZZTrM[_0x59c3c8(0x1b8)](_0x1ab546);}else{if(_0x469179[_0x59c3c8(0x130)]?.[_0x59c3c8(0x13d)]){const _0x1c50c2=_0x469179['\x65\x78\x74\x65\x6e\x64\x65\x64\x54\x65\x78\x74\x4d\x65\x73\x73\x61\x67\x65'][_0x59c3c8(0x13d)],_0x4f09c5={};_0x4f09c5[_0x59c3c8(0x13d)]=_0x1c50c2,await _0x3f38b4[_0x59c3c8(0x155)](_0x33c4bb,_0x4f09c5);}else{if('\x50\x44\x49\x6b\x78'!==_0x36a8aa[_0x59c3c8(0x140)]){const _0x54b986={};_0x54b986[_0x59c3c8(0x13d)]='\u274c',_0x54b986[_0x59c3c8(0x182)]=_0x5b03ef['\x6b\x65\x79'];const _0x3f6b7c={};_0x3f6b7c[_0x59c3c8(0x18b)]=_0x54b986,await _0x3f38b4[_0x59c3c8(0x155)](_0x348166,_0x3f6b7c);return;}else(function(){return![];}['\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72'](GZZTrM[_0x59c3c8(0x17e)](GZZTrM['\x49\x65\x65\x4c\x6c'],_0x59c3c8(0x152)))[_0x59c3c8(0x162)](GZZTrM[_0x59c3c8(0x165)]));}}}}const _0x151f3f={};_0x151f3f[_0x59c3c8(0x13d)]='\u2705',_0x151f3f['\x6b\x65\x79']=_0x5b03ef['\x6b\x65\x79'];const _0x134b1d={};_0x134b1d['\x72\x65\x61\x63\x74']=_0x151f3f,await _0x3f38b4['\x73\x65\x6e\x64\x4d\x65\x73\x73\x61\x67\x65'](_0x348166,_0x134b1d);}catch(_0x2563e8){if(_0x36a8aa[_0x59c3c8(0x167)](_0x36a8aa['\x64\x61\x4a\x4c\x52'],_0x36a8aa[_0x59c3c8(0x157)])){if(_0x44b2cc){const _0x1357de=_0x5e001b[_0x59c3c8(0x162)](_0x4e3077,arguments);return _0x47a745=null,_0x1357de;}}else{console['\x65\x72\x72\x6f\x72'](_0x36a8aa[_0x59c3c8(0x163)],_0x2563e8[_0x59c3c8(0x15b)]);const _0x230042={};_0x230042['\x74\x65\x78\x74']='\u274c',_0x230042[_0x59c3c8(0x182)]=_0x5b03ef[_0x59c3c8(0x182)];const _0x3b7a09={};_0x3b7a09['\x72\x65\x61\x63\x74']=_0x230042,await _0x3f38b4[_0x59c3c8(0x155)](_0x348166,_0x3b7a09);}}}module['\x65\x78\x70\x6f\x72\x74\x73']=saveStatusCommand;function _0x207e(_0x247e5,_0x5bc728){_0x247e5=_0x247e5-(0x230c+-0xcf+-0x2114);const _0x39b849=_0x5103();let _0x91c30b=_0x39b849[_0x247e5];if(_0x207e['\x6b\x53\x45\x6f\x57\x62']===undefined){var _0x3b81fa=function(_0x20eed8){const _0x5f0c49='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x4446eb='',_0x118a0c='',_0x4880ed=_0x4446eb+_0x3b81fa;for(let _0x4ab920=-0x21a1+-0x6*-0x15+0x2123,_0xbbfc56,_0x2f3a57,_0x33d82c=-0x1cc+0x1880+-0x16b4;_0x2f3a57=_0x20eed8['\x63\x68\x61\x72\x41\x74'](_0x33d82c++);~_0x2f3a57&&(_0xbbfc56=_0x4ab920%(0x96*-0xa+0xee7*-0x1+-0x9*-0x24f)?_0xbbfc56*(-0x96a+-0x1*-0x68a+0x1*0x320)+_0x2f3a57:_0x2f3a57,_0x4ab920++%(-0x200f+-0x1*-0x1aac+0x567))?_0x4446eb+=_0x4880ed['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x33d82c+(0x71d*-0x1+0xcf7*-0x1+-0x1*-0x141e))-(0x2*0x12f9+0x18fd+-0x9*0x6fd)!==0x128*-0x6+-0x1ea5+0x2595?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x12*0x207+0x1*-0x97d+0x2efa&_0xbbfc56>>(-(0x6c7*-0x1+0x1d84+-0x16bb)*_0x4ab920&0x2e*-0xb5+-0x16+-0x1*-0x20a2)):_0x4ab920:0xb7b*-0x2+-0x1*0x1859+0x2f4f){_0x2f3a57=_0x5f0c49['\x69\x6e\x64\x65\x78\x4f\x66'](_0x2f3a57);}for(let _0x4136ed=-0xf20+-0x6ce+-0x191*-0xe,_0x45dc21=_0x4446eb['\x6c\x65\x6e\x67\x74\x68'];_0x4136ed<_0x45dc21;_0x4136ed++){_0x118a0c+='\x25'+('\x30\x30'+_0x4446eb['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x4136ed)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0xfb7+0x1229+-0x262))['\x73\x6c\x69\x63\x65'](-(-0x35f+0x1*-0x4ed+0x1*0x84e));}return decodeURIComponent(_0x118a0c);};_0x207e['\x65\x4e\x44\x78\x77\x54']=_0x3b81fa,_0x207e['\x6d\x4a\x72\x71\x62\x61']={},_0x207e['\x6b\x53\x45\x6f\x57\x62']=!![];}const _0x3ca59e=_0x39b849[0x2576+-0x1*0x84a+-0x1*0x1d2c],_0x298388=_0x247e5+_0x3ca59e,_0x2a1f23=_0x207e['\x6d\x4a\x72\x71\x62\x61'][_0x298388];if(!_0x2a1f23){const _0x42932d=function(_0x3f6af1){this['\x4d\x77\x53\x70\x72\x42']=_0x3f6af1,this['\x42\x42\x6c\x75\x47\x61']=[-0x4*-0x397+0x52c*-0x2+-0x4f*0xd,0x221*0x1+-0x4f*-0xa+0x10b*-0x5,0x120e*0x1+-0x1*-0xd99+-0x49*0x6f],this['\x4b\x53\x41\x69\x4c\x76']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';},this['\x75\x61\x4c\x6e\x72\x43']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['\x78\x4b\x6d\x61\x54\x56']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x42932d['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x54\x77\x45\x44\x54\x41']=function(){const _0xffb6c2=new RegExp(this['\x75\x61\x4c\x6e\x72\x43']+this['\x78\x4b\x6d\x61\x54\x56']),_0x217fdc=_0xffb6c2['\x74\x65\x73\x74'](this['\x4b\x53\x41\x69\x4c\x76']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x42\x42\x6c\x75\x47\x61'][0x350+0x3*-0x566+0xce3]:--this['\x42\x42\x6c\x75\x47\x61'][0x139*0x3+-0xc7d+0x8d2];return this['\x62\x51\x67\x67\x47\x4a'](_0x217fdc);},_0x42932d['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x62\x51\x67\x67\x47\x4a']=function(_0x28b784){if(!Boolean(~_0x28b784))return _0x28b784;return this['\x68\x42\x59\x55\x47\x71'](this['\x4d\x77\x53\x70\x72\x42']);},_0x42932d['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x68\x42\x59\x55\x47\x71']=function(_0xbc049e){for(let _0x21ff22=0x1*0x3a1+0x844+-0x91*0x15,_0x43d50d=this['\x42\x42\x6c\x75\x47\x61']['\x6c\x65\x6e\x67\x74\x68'];_0x21ff22<_0x43d50d;_0x21ff22++){this['\x42\x42\x6c\x75\x47\x61']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']())),_0x43d50d=this['\x42\x42\x6c\x75\x47\x61']['\x6c\x65\x6e\x67\x74\x68'];}return _0xbc049e(this['\x42\x42\x6c\x75\x47\x61'][0xe3*-0x23+-0x30*-0x4a+-0x17*-0xbf]);},new _0x42932d(_0x207e)['\x54\x77\x45\x44\x54\x41'](),_0x91c30b=_0x207e['\x65\x4e\x44\x78\x77\x54'](_0x91c30b),_0x207e['\x6d\x4a\x72\x71\x62\x61'][_0x298388]=_0x91c30b;}else _0x91c30b=_0x2a1f23;return _0x91c30b;}function _0x22a846(_0x12febb){const _0x1ca8b1=_0x3a2f8f,_0x33579b={'\x51\x56\x79\x69\x74':_0x1ca8b1(0x190),'\x48\x51\x57\x69\x6e':_0x1ca8b1(0x14a),'\x52\x57\x41\x4f\x57':function(_0x111b67,_0x53b0a7){return _0x111b67+_0x53b0a7;},'\x6b\x4c\x76\x63\x5a':_0x1ca8b1(0x18a),'\x61\x43\x4f\x71\x57':function(_0x563243,_0x4f77ed){return _0x563243===_0x4f77ed;},'\x77\x6c\x4e\x67\x79':_0x1ca8b1(0x18e),'\x4c\x6b\x63\x63\x49':function(_0x59a62a,_0x418058){return _0x59a62a!==_0x418058;},'\x6c\x4d\x4e\x62\x74':_0x1ca8b1(0x189),'\x49\x77\x55\x78\x44':_0x1ca8b1(0x135),'\x79\x4e\x61\x5a\x6d':_0x1ca8b1(0x132),'\x70\x63\x42\x63\x46':function(_0x3528a3,_0x5a840c){return _0x3528a3!==_0x5a840c;},'\x77\x79\x6e\x7a\x4a':_0x1ca8b1(0x1ad),'\x74\x4b\x4a\x77\x48':_0x1ca8b1(0x16f),'\x6b\x4c\x4a\x4a\x79':function(_0x2dcf36,_0x50de43){return _0x2dcf36!==_0x50de43;},'\x76\x43\x71\x64\x41':function(_0x3877ac,_0x525609){return _0x3877ac/_0x525609;},'\x62\x50\x54\x57\x64':_0x1ca8b1(0x14b),'\x59\x50\x56\x75\x62':function(_0x4fff12,_0x3ed797){return _0x4fff12%_0x3ed797;},'\x68\x56\x6a\x6d\x71':_0x1ca8b1(0x13c),'\x61\x43\x58\x4e\x48':function(_0x122683,_0x22bd86){return _0x122683+_0x22bd86;},'\x65\x48\x52\x69\x4a':'\x64\x65\x62\x75','\x46\x45\x48\x72\x6f':'\x67\x67\x65\x72','\x46\x54\x62\x72\x72':'\x73\x74\x61\x74\x65\x4f\x62\x6a\x65\x63\x74','\x76\x67\x72\x74\x6f':function(_0x26d4f9,_0x5a92cb){return _0x26d4f9+_0x5a92cb;},'\x6d\x46\x53\x74\x6d':_0x1ca8b1(0x13b),'\x62\x53\x52\x50\x51':_0x1ca8b1(0x1b1),'\x61\x53\x55\x7a\x69':'\x48\x4a\x52\x65\x75','\x65\x75\x66\x7a\x58':function(_0x2a4202,_0x4743a0){return _0x2a4202!==_0x4743a0;},'\x6f\x57\x4c\x4b\x52':_0x1ca8b1(0x141),'\x47\x41\x6d\x71\x48':'\x44\x77\x79\x63\x61','\x65\x59\x67\x64\x53':function(_0x27c669,_0x541f50){return _0x27c669(_0x541f50);}};function _0x3368f7(_0x2caf50){const _0x4772d3=_0x1ca8b1,_0x17bf94={'\x64\x6e\x70\x66\x4b':_0x33579b[_0x4772d3(0x1b0)],'\x55\x50\x49\x57\x47':function(_0x4d77bc,_0x28a7f6){return _0x4d77bc(_0x28a7f6);},'\x4e\x46\x63\x61\x7a':_0x33579b[_0x4772d3(0x149)],'\x44\x6a\x4a\x58\x43':function(_0x172b8d,_0x56fa23){return _0x33579b['\x52\x57\x41\x4f\x57'](_0x172b8d,_0x56fa23);},'\x44\x73\x4a\x74\x69':_0x33579b[_0x4772d3(0x171)],'\x6c\x67\x4e\x42\x67':function(_0x277ab7){return _0x277ab7();}};if(_0x33579b['\x61\x43\x4f\x71\x57'](typeof _0x2caf50,_0x33579b['\x77\x6c\x4e\x67\x79'])){if(_0x33579b[_0x4772d3(0x187)](_0x33579b[_0x4772d3(0x143)],_0x33579b[_0x4772d3(0x191)]))return function(_0x21d0fe){}[_0x4772d3(0x14f)](_0x4772d3(0x166))[_0x4772d3(0x162)](_0x33579b['\x79\x4e\x61\x5a\x6d']);else{if(_0x1d3a89){const _0x4840c0=_0x492ffa[_0x4772d3(0x162)](_0x15e99b,arguments);return _0x1c8212=null,_0x4840c0;}}}else{if(_0x33579b[_0x4772d3(0x17d)](_0x33579b[_0x4772d3(0x150)],_0x33579b[_0x4772d3(0x173)]))_0x33579b['\x6b\x4c\x4a\x4a\x79'](_0x33579b[_0x4772d3(0x1ae)]('',_0x33579b[_0x4772d3(0x1a8)](_0x2caf50,_0x2caf50))[_0x33579b[_0x4772d3(0x1b7)]],-0x6d*0x46+-0x2ed+0x20bc)||_0x33579b['\x61\x43\x4f\x71\x57'](_0x33579b[_0x4772d3(0x184)](_0x2caf50,0x8e*-0x17+0x170b+-0xa35),-0x243*-0xd+0x1d4f+-0x343*0x12)?_0x33579b[_0x4772d3(0x12e)]!==_0x4772d3(0x168)?function(){return!![];}['\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72'](_0x33579b[_0x4772d3(0x158)](_0x33579b['\x65\x48\x52\x69\x4a'],_0x33579b[_0x4772d3(0x1ac)]))[_0x4772d3(0x196)](_0x4772d3(0x13b)):_0x2321a8(this,function(){const _0x498bd8=_0x4772d3,_0x1ddb11=new _0x41364e(_0x17bf94['\x64\x6e\x70\x66\x4b']),_0x1a5fdd=new _0x2310eb('\x5c\x2b\x5c\x2b\x20\x2a\x28\x3f\x3a\x5b\x61\x2d\x7a\x41\x2d\x5a\x5f\x24\x5d\x5b\x30\x2d\x39\x61\x2d\x7a\x41\x2d\x5a\x5f\x24\x5d\x2a\x29','\x69'),_0x35ac09=_0x17bf94[_0x498bd8(0x1aa)](_0x4c6cac,_0x17bf94['\x4e\x46\x63\x61\x7a']);!_0x1ddb11[_0x498bd8(0x1b9)](_0x17bf94[_0x498bd8(0x183)](_0x35ac09,_0x498bd8(0x14c)))||!_0x1a5fdd[_0x498bd8(0x1b9)](_0x17bf94[_0x498bd8(0x183)](_0x35ac09,_0x17bf94[_0x498bd8(0x199)]))?_0x17bf94[_0x498bd8(0x1aa)](_0x35ac09,'\x30'):_0x17bf94[_0x498bd8(0x16d)](_0x580752);})():function(){return![];}[_0x4772d3(0x14f)](_0x4772d3(0x133)+_0x4772d3(0x152))[_0x4772d3(0x162)](_0x33579b[_0x4772d3(0x159)]);else return![];}_0x3368f7(++_0x2caf50);}try{if(_0x33579b['\x62\x53\x52\x50\x51']!==_0x33579b['\x61\x53\x55\x7a\x69']){if(_0x12febb)return _0x33579b[_0x1ca8b1(0x16b)](_0x33579b[_0x1ca8b1(0x1b6)],_0x33579b[_0x1ca8b1(0x1b3)])?_0x3368f7:!![];else _0x33579b['\x65\x59\x67\x64\x53'](_0x3368f7,-0x2299+0x1b2d+0x76c);}else(function(){return!![];}[_0x1ca8b1(0x14f)](_0x33579b['\x76\x67\x72\x74\x6f'](_0x1ca8b1(0x133),_0x33579b[_0x1ca8b1(0x1ac)]))[_0x1ca8b1(0x196)](_0x33579b[_0x1ca8b1(0x129)]));}catch(_0x32f6b5){}}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const yts = require('yt-search');
|
|
3
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
4
|
+
|
|
5
|
+
const AXIOS_DEFAULTS = {
|
|
6
|
+
timeout: 60000,
|
|
7
|
+
headers: {
|
|
8
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
|
9
|
+
'Accept': 'application/json, text/plain, */*'
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
async function tryRequest(getter, attempts = 3) {
|
|
14
|
+
let lastError;
|
|
15
|
+
for (let i = 1; i <= attempts; i++) {
|
|
16
|
+
try {
|
|
17
|
+
return await getter();
|
|
18
|
+
} catch (err) {
|
|
19
|
+
lastError = err;
|
|
20
|
+
if (i < attempts) {
|
|
21
|
+
await new Promise(r => setTimeout(r, i * 1000));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
throw lastError;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function getAudioDownload(youtubeUrl) {
|
|
29
|
+
const apis = [
|
|
30
|
+
`https://apiskeith.top/download/audio?url=${encodeURIComponent(youtubeUrl)}`,
|
|
31
|
+
`https://apiskeith.top/download/ytmp3?url=${encodeURIComponent(youtubeUrl)}`,
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
let lastError;
|
|
35
|
+
for (const apiUrl of apis) {
|
|
36
|
+
try {
|
|
37
|
+
const res = await tryRequest(() => axios.get(apiUrl, AXIOS_DEFAULTS));
|
|
38
|
+
|
|
39
|
+
if (!res?.data) continue;
|
|
40
|
+
|
|
41
|
+
const data = res.data;
|
|
42
|
+
const result = data.result || data;
|
|
43
|
+
|
|
44
|
+
const downloadUrl = (typeof result === 'string' && result.startsWith('http')) ? result :
|
|
45
|
+
result?.download || result?.url || result?.downloadUrl || result?.link || null;
|
|
46
|
+
|
|
47
|
+
if (downloadUrl) {
|
|
48
|
+
return {
|
|
49
|
+
download: downloadUrl,
|
|
50
|
+
title: result?.title || data?.title || 'YouTube Audio',
|
|
51
|
+
thumbnail: result?.thumbnail || result?.thumb || data?.thumbnail || '',
|
|
52
|
+
duration: result?.duration || data?.duration || '0:00'
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
lastError = err;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
throw lastError || new Error('All audio APIs failed');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function songCommand(sock, chatId, message) {
|
|
65
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
66
|
+
const fake = createFakeContact(senderId);
|
|
67
|
+
const botName = getBotName();
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const text = message.message?.conversation ||
|
|
71
|
+
message.message?.extendedTextMessage?.text || '';
|
|
72
|
+
const parts = text.split(' ');
|
|
73
|
+
const query = parts.slice(1).join(' ').trim();
|
|
74
|
+
|
|
75
|
+
if (!query) {
|
|
76
|
+
return sock.sendMessage(chatId, {
|
|
77
|
+
text: `✦ *${botName}* Song\n\nUse: .song <name or link>\nExample: .song Never Gonna Give You Up`
|
|
78
|
+
}, { quoted: fake });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let video;
|
|
82
|
+
|
|
83
|
+
if (query.includes('youtube.com') || query.includes('youtu.be')) {
|
|
84
|
+
const search = await yts(query);
|
|
85
|
+
video = search?.videos?.[0] || {
|
|
86
|
+
url: query,
|
|
87
|
+
title: 'YouTube Audio',
|
|
88
|
+
thumbnail: 'https://img.youtube.com/vi/default/hqdefault.jpg',
|
|
89
|
+
timestamp: '0:00'
|
|
90
|
+
};
|
|
91
|
+
} else {
|
|
92
|
+
const search = await yts(query);
|
|
93
|
+
if (!search?.videos?.length) {
|
|
94
|
+
return sock.sendMessage(chatId, {
|
|
95
|
+
text: `✦ *${botName}*\nNo results found for that query.`
|
|
96
|
+
}, { quoted: fake });
|
|
97
|
+
}
|
|
98
|
+
video = search.videos[0];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
await sock.sendMessage(chatId, {
|
|
102
|
+
text: `✦ *${botName}*\n\nTitle: ${video.title}\nDuration: ${video.timestamp || '0:00'}\n\nDownloading...`
|
|
103
|
+
}, { quoted: fake });
|
|
104
|
+
|
|
105
|
+
const audio = await getAudioDownload(video.url);
|
|
106
|
+
|
|
107
|
+
await sock.sendMessage(chatId, {
|
|
108
|
+
audio: { url: audio.download },
|
|
109
|
+
mimetype: 'audio/mpeg',
|
|
110
|
+
ptt: false,
|
|
111
|
+
contextInfo: {
|
|
112
|
+
externalAdReply: {
|
|
113
|
+
title: audio.title || video.title,
|
|
114
|
+
body: botName,
|
|
115
|
+
thumbnailUrl: audio.thumbnail || video.thumbnail,
|
|
116
|
+
sourceUrl: video.url,
|
|
117
|
+
mediaType: 1,
|
|
118
|
+
renderLargerThumbnail: false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, { quoted: fake });
|
|
122
|
+
|
|
123
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
124
|
+
|
|
125
|
+
} catch (err) {
|
|
126
|
+
console.error('Song command error:', err.message);
|
|
127
|
+
await sock.sendMessage(chatId, {
|
|
128
|
+
text: `✦ *${botName}*\nFailed: ${err.message}`
|
|
129
|
+
}, { quoted: fake });
|
|
130
|
+
|
|
131
|
+
await sock.sendMessage(chatId, { react: { text: '❌', key: message.key } });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
module.exports = songCommand;
|