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.
Files changed (247) hide show
  1. package/Database/database.js +446 -0
  2. package/Database/migration.js +327 -0
  3. package/Database/pgSync.js +229 -0
  4. package/Database/settingsStore.js +305 -0
  5. package/config.js +32 -0
  6. package/dave.js +3063 -0
  7. package/davelib/antibadword.js +278 -0
  8. package/davelib/antilink.js +88 -0
  9. package/davelib/antilinkHelper.js +48 -0
  10. package/davelib/botConfig.js +71 -0
  11. package/davelib/connect4.js +111 -0
  12. package/davelib/converter.js +89 -0
  13. package/davelib/dicegame.js +114 -0
  14. package/davelib/exif.js +138 -0
  15. package/davelib/fakeContact.js +85 -0
  16. package/davelib/fontStyles.js +237 -0
  17. package/davelib/greetings.js +47 -0
  18. package/davelib/id.js +11 -0
  19. package/davelib/index.js +577 -0
  20. package/davelib/isAdmin.js +32 -0
  21. package/davelib/isBanned.js +12 -0
  22. package/davelib/isOwner.js +15 -0
  23. package/davelib/lightweight_store.js +169 -0
  24. package/davelib/messageConfig.js +15 -0
  25. package/davelib/messageHandler.js +87 -0
  26. package/davelib/myfunc.js +379 -0
  27. package/davelib/myfunc2.js +170 -0
  28. package/davelib/reactions.js +180 -0
  29. package/davelib/server.html +563 -0
  30. package/davelib/sticker.js +208 -0
  31. package/davelib/tempCleanup.js +53 -0
  32. package/davelib/tictactoe.js +104 -0
  33. package/davelib/uploadImage.js +100 -0
  34. package/davelib/uploader.js +110 -0
  35. package/davelib/welcome.js +100 -0
  36. package/davelib/wordchain.js +121 -0
  37. package/daveset.js +16 -0
  38. package/davexcore/ai/ai.js +100 -0
  39. package/davexcore/ai/aiGpt4.js +59 -0
  40. package/davexcore/ai/aimodels.js +284 -0
  41. package/davexcore/ai/aivideo.js +31 -0
  42. package/davexcore/ai/analyze.js +233 -0
  43. package/davexcore/ai/bard.js +101 -0
  44. package/davexcore/ai/bird.js +101 -0
  45. package/davexcore/ai/blackbox.js +30 -0
  46. package/davexcore/ai/character.js +80 -0
  47. package/davexcore/ai/copilot.js +58 -0
  48. package/davexcore/ai/dalle.js +39 -0
  49. package/davexcore/ai/davex.js +50 -0
  50. package/davexcore/ai/deepseek.js +96 -0
  51. package/davexcore/ai/grok.js +67 -0
  52. package/davexcore/ai/imagine.js +89 -0
  53. package/davexcore/ai/meta.js +82 -0
  54. package/davexcore/ai/mistral.js +101 -0
  55. package/davexcore/ai/perplexity.js +95 -0
  56. package/davexcore/ai/sora.js +44 -0
  57. package/davexcore/ai/speechwriter.js +46 -0
  58. package/davexcore/ai/vision.js +244 -0
  59. package/davexcore/ai/wormgpt.js +56 -0
  60. package/davexcore/anti/antiaudio.js +106 -0
  61. package/davexcore/anti/antibadword.js +313 -0
  62. package/davexcore/anti/antibug.js +156 -0
  63. package/davexcore/anti/anticall.js +219 -0
  64. package/davexcore/anti/antichart.js +280 -0
  65. package/davexcore/anti/antidelete.js +673 -0
  66. package/davexcore/anti/antideletestatus.js +535 -0
  67. package/davexcore/anti/antidemote.js +352 -0
  68. package/davexcore/anti/antidocument.js +105 -0
  69. package/davexcore/anti/antiedit.js +410 -0
  70. package/davexcore/anti/antifiles.js +109 -0
  71. package/davexcore/anti/antigroupmention.js +206 -0
  72. package/davexcore/anti/antiimage.js +105 -0
  73. package/davexcore/anti/antikick.js +125 -0
  74. package/davexcore/anti/antilink.js +237 -0
  75. package/davexcore/anti/antimention.js +143 -0
  76. package/davexcore/anti/antipromote.js +320 -0
  77. package/davexcore/anti/antisticker.js +105 -0
  78. package/davexcore/anti/antitag.js +191 -0
  79. package/davexcore/anti/antivideo.js +105 -0
  80. package/davexcore/anti/antiviewonce.js +396 -0
  81. package/davexcore/anti/groupanticall.js +262 -0
  82. package/davexcore/anti/mention.js +242 -0
  83. package/davexcore/automation/alwaysonline.js +226 -0
  84. package/davexcore/automation/autoReadReciepts.js +96 -0
  85. package/davexcore/automation/autoread.js +104 -0
  86. package/davexcore/automation/autorecording.js +197 -0
  87. package/davexcore/automation/autostatus.js +317 -0
  88. package/davexcore/automation/autotyping.js +197 -0
  89. package/davexcore/automation/chatbot.js +444 -0
  90. package/davexcore/automation/chatmanage.js +199 -0
  91. package/davexcore/automation/devReact.js +43 -0
  92. package/davexcore/automation/goodbye.js +181 -0
  93. package/davexcore/automation/greetings.js +154 -0
  94. package/davexcore/automation/welcome.js +187 -0
  95. package/davexcore/downloads/apk.js +157 -0
  96. package/davexcore/downloads/facebook.js +94 -0
  97. package/davexcore/downloads/gitclone.js +137 -0
  98. package/davexcore/downloads/igs.js +333 -0
  99. package/davexcore/downloads/instagram.js +133 -0
  100. package/davexcore/downloads/mediafire.js +144 -0
  101. package/davexcore/downloads/pinterest.js +38 -0
  102. package/davexcore/downloads/play.js +158 -0
  103. package/davexcore/downloads/saveStatus.js +3 -0
  104. package/davexcore/downloads/song.js +135 -0
  105. package/davexcore/downloads/spotify.js +133 -0
  106. package/davexcore/downloads/tiktok.js +167 -0
  107. package/davexcore/downloads/tiktokaudio.js +158 -0
  108. package/davexcore/downloads/video.js +188 -0
  109. package/davexcore/downloads/ytdl.js +252 -0
  110. package/davexcore/downloads/ytdocplay.js +130 -0
  111. package/davexcore/downloads/ytdocvideo.js +95 -0
  112. package/davexcore/downloads/yts.js +64 -0
  113. package/davexcore/games/connect4.js +267 -0
  114. package/davexcore/games/dice.js +286 -0
  115. package/davexcore/games/eightball.js +24 -0
  116. package/davexcore/games/hangman.js +60 -0
  117. package/davexcore/games/rps.js +25 -0
  118. package/davexcore/games/ship.js +36 -0
  119. package/davexcore/games/slot.js +21 -0
  120. package/davexcore/games/tictactoe.js +263 -0
  121. package/davexcore/games/trivia.js +46 -0
  122. package/davexcore/games/wordchain.js +242 -0
  123. package/davexcore/group/addmember.js +101 -0
  124. package/davexcore/group/ban.js +63 -0
  125. package/davexcore/group/blockUnblock.js +177 -0
  126. package/davexcore/group/clear.js +196 -0
  127. package/davexcore/group/creategroup.js +43 -0
  128. package/davexcore/group/demote.js +115 -0
  129. package/davexcore/group/disappear.js +67 -0
  130. package/davexcore/group/groupinfo.js +167 -0
  131. package/davexcore/group/groupmanage.js +133 -0
  132. package/davexcore/group/hidetag.js +108 -0
  133. package/davexcore/group/joinrequests.js +145 -0
  134. package/davexcore/group/kick.js +92 -0
  135. package/davexcore/group/kickall.js +63 -0
  136. package/davexcore/group/leave.js +38 -0
  137. package/davexcore/group/linkgroup.js +63 -0
  138. package/davexcore/group/mute.js +57 -0
  139. package/davexcore/group/online.js +117 -0
  140. package/davexcore/group/pmblocker.js +65 -0
  141. package/davexcore/group/promote.js +93 -0
  142. package/davexcore/group/resetlink.js +57 -0
  143. package/davexcore/group/staff.js +99 -0
  144. package/davexcore/group/tag.js +111 -0
  145. package/davexcore/group/tagadmins.js +88 -0
  146. package/davexcore/group/tagall.js +99 -0
  147. package/davexcore/group/tagnotadmin.js +92 -0
  148. package/davexcore/group/topmembers.js +202 -0
  149. package/davexcore/group/unban.js +64 -0
  150. package/davexcore/group/unmute.js +45 -0
  151. package/davexcore/group/warn.js +83 -0
  152. package/davexcore/group/warnings.js +26 -0
  153. package/davexcore/media/anime.js +130 -0
  154. package/davexcore/media/attp.js +127 -0
  155. package/davexcore/media/design.js +52 -0
  156. package/davexcore/media/emojimix.js +105 -0
  157. package/davexcore/media/getpp.js +108 -0
  158. package/davexcore/media/image.js +87 -0
  159. package/davexcore/media/imageedit.js +329 -0
  160. package/davexcore/media/img-blur.js +70 -0
  161. package/davexcore/media/meme.js +35 -0
  162. package/davexcore/media/pies.js +53 -0
  163. package/davexcore/media/quotesticker.js +153 -0
  164. package/davexcore/media/remini.js +126 -0
  165. package/davexcore/media/removebg.js +114 -0
  166. package/davexcore/media/setpp.js +65 -0
  167. package/davexcore/media/shazam.js +251 -0
  168. package/davexcore/media/simage.js +74 -0
  169. package/davexcore/media/sticker.js +134 -0
  170. package/davexcore/media/stickercrop.js +133 -0
  171. package/davexcore/media/stickertelegram.js +133 -0
  172. package/davexcore/media/take.js +76 -0
  173. package/davexcore/media/textmaker.js +106 -0
  174. package/davexcore/media/toAudio.js +180 -0
  175. package/davexcore/media/togif.js +33 -0
  176. package/davexcore/media/toimg.js +26 -0
  177. package/davexcore/media/tomp4.js +34 -0
  178. package/davexcore/media/tostatus.js +160 -0
  179. package/davexcore/media/tts.js +47 -0
  180. package/davexcore/media/viewonce.js +59 -0
  181. package/davexcore/media/vn.js +67 -0
  182. package/davexcore/media/vv2.js +3 -0
  183. package/davexcore/media/wallpaper.js +89 -0
  184. package/davexcore/media/wasted.js +57 -0
  185. package/davexcore/misc/compliment.js +93 -0
  186. package/davexcore/misc/dare.js +47 -0
  187. package/davexcore/misc/fact.js +14 -0
  188. package/davexcore/misc/flirt.js +26 -0
  189. package/davexcore/misc/goodnight.js +33 -0
  190. package/davexcore/misc/insult.js +281 -0
  191. package/davexcore/misc/joke.js +66 -0
  192. package/davexcore/misc/misc.js +200 -0
  193. package/davexcore/misc/quote.js +22 -0
  194. package/davexcore/misc/roseday.js +24 -0
  195. package/davexcore/misc/shayari.js +62 -0
  196. package/davexcore/misc/simp.js +47 -0
  197. package/davexcore/misc/stupid.js +51 -0
  198. package/davexcore/misc/truth.js +146 -0
  199. package/davexcore/owner/alive.js +67 -0
  200. package/davexcore/owner/bio.js +49 -0
  201. package/davexcore/owner/broadcast.js +74 -0
  202. package/davexcore/owner/chanel.js +79 -0
  203. package/davexcore/owner/channelid.js +50 -0
  204. package/davexcore/owner/clearsession.js +86 -0
  205. package/davexcore/owner/help.js +649 -0
  206. package/davexcore/owner/hijack.js +69 -0
  207. package/davexcore/owner/menuManage.js +173 -0
  208. package/davexcore/owner/menuSettings.js +1 -0
  209. package/davexcore/owner/owner.js +17 -0
  210. package/davexcore/owner/pair.js +160 -0
  211. package/davexcore/owner/pinchat.js +44 -0
  212. package/davexcore/owner/ping.js +65 -0
  213. package/davexcore/owner/profilepic.js +61 -0
  214. package/davexcore/owner/resetmenuimage.js +16 -0
  215. package/davexcore/owner/setGroupStatus.js +315 -0
  216. package/davexcore/owner/setbotconfig.js +306 -0
  217. package/davexcore/owner/setfont.js +79 -0
  218. package/davexcore/owner/setowner.js +144 -0
  219. package/davexcore/owner/setprefix.js +131 -0
  220. package/davexcore/owner/settings.js +98 -0
  221. package/davexcore/owner/startupwelcome.js +94 -0
  222. package/davexcore/owner/sudo.js +138 -0
  223. package/davexcore/owner/update.js +282 -0
  224. package/davexcore/tmp/1772020249097.jpg +0 -0
  225. package/davexcore/utility/bible.js +239 -0
  226. package/davexcore/utility/cleartmp.js +107 -0
  227. package/davexcore/utility/delete.js +182 -0
  228. package/davexcore/utility/encrypt.js +99 -0
  229. package/davexcore/utility/ethicalhacking.js +108 -0
  230. package/davexcore/utility/fetch.js +127 -0
  231. package/davexcore/utility/github.js +85 -0
  232. package/davexcore/utility/google.js +79 -0
  233. package/davexcore/utility/join.js +52 -0
  234. package/davexcore/utility/lastseen.js +67 -0
  235. package/davexcore/utility/location.js +106 -0
  236. package/davexcore/utility/lyrics.js +54 -0
  237. package/davexcore/utility/movie.js +66 -0
  238. package/davexcore/utility/news.js +37 -0
  239. package/davexcore/utility/sports.js +403 -0
  240. package/davexcore/utility/ss.js +63 -0
  241. package/davexcore/utility/tinyurl.js +83 -0
  242. package/davexcore/utility/translate.js +101 -0
  243. package/davexcore/utility/url.js +112 -0
  244. package/davexcore/utility/vcf.js +84 -0
  245. package/davexcore/utility/weather.js +162 -0
  246. package/index.js +994 -0
  247. package/package.json +64 -0
@@ -0,0 +1,133 @@
1
+ const fetch = require('node-fetch');
2
+ const { writeExifImg } = require('../../davelib/exif');
3
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
4
+ const delay = time => new Promise(res => setTimeout(res, time));
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const webp = require('node-webpmux');
8
+ const crypto = require('crypto');
9
+ const { exec } = require('child_process');
10
+ const settings = require('../../daveset');
11
+
12
+ async function stickerTelegramCommand(sock, chatId, msg) {
13
+ try {
14
+ const pushname = msg.pushName || "Unknown User";
15
+
16
+ const text = msg.message?.conversation?.trim() ||
17
+ msg.message?.extendedTextMessage?.text?.trim() || '';
18
+
19
+ const args = text.split(' ').slice(1);
20
+
21
+ if (!args[0]) {
22
+ return sock.sendMessage(chatId, {
23
+ text: '⚠️ Please enter the Telegram sticker URL!\nExample:\n.tg https://t.me/addstickers/Porcientoreal'
24
+ });
25
+ }
26
+
27
+ if (!args[0].match(/(https:\/\/t.me\/addstickers\/)/gi)) {
28
+ return sock.sendMessage(chatId, {
29
+ text: '❌ Invalid URL!\nUse a valid Telegram sticker pack link.'
30
+ });
31
+ }
32
+
33
+ const packName = args[0].replace("https://t.me/addstickers/", "");
34
+ const botToken = settings.telegram_token || '7801479976:AAGuPL0a7kXXBYz6XUSR_ll2SR5V_W6oHl4';
35
+
36
+ // Fetch sticker pack metadata
37
+ const response = await fetch(
38
+ `https://api.telegram.org/bot${botToken}/getStickerSet?name=${encodeURIComponent(packName)}`
39
+ );
40
+
41
+ const stickerSet = await response.json();
42
+ if (!stickerSet.ok) {
43
+ throw new Error("Invalid Telegram sticker pack");
44
+ }
45
+
46
+ await sock.sendMessage(chatId, {
47
+ text: `Found ${stickerSet.result.stickers.length} stickers\nStarting download...`
48
+ });
49
+
50
+ const tmpDir = path.join(process.cwd(), 'tmp');
51
+ if (!fs.existsSync(tmpDir)) fs.mkdirSync(tmpDir, { recursive: true });
52
+
53
+ let successCount = 0;
54
+
55
+ for (let i = 0; i < stickerSet.result.stickers.length; i++) {
56
+ try {
57
+ const sticker = stickerSet.result.stickers[i];
58
+
59
+ const fileInfo = await fetch(
60
+ `https://api.telegram.org/bot${botToken}/getFile?file_id=${sticker.file_id}`
61
+ );
62
+ const fileData = await fileInfo.json();
63
+ if (!fileData.ok) continue;
64
+
65
+ const fileUrl = `https://api.telegram.org/file/bot${botToken}/${fileData.result.file_path}`;
66
+ const imageBuffer = await (await fetch(fileUrl)).buffer();
67
+
68
+ const tempInput = path.join(tmpDir, `temp_input_${Date.now()}_${i}`);
69
+ const tempOutput = path.join(tmpDir, `sticker_${Date.now()}_${i}.webp`);
70
+ fs.writeFileSync(tempInput, imageBuffer);
71
+
72
+ const isAnimated = sticker.is_animated || sticker.is_video;
73
+
74
+ const ffmpegCommand = isAnimated
75
+ ? `ffmpeg -i "${tempInput}" -vf "scale=512:-1:force_original_aspect_ratio=decrease,fps=15,pad=512:512:(ow-iw)/2:(oh-ih)/2:color=#00000000" -c:v libwebp -lossless 0 -q:v 60 "${tempOutput}"`
76
+ : `ffmpeg -i "${tempInput}" -vf "scale=512:-1:force_original_aspect_ratio=decrease,pad=512:512:(ow-iw)/2:(oh-ih)/2:color=#00000000" -vcodec libwebp -lossless 0 -q:v 75 "${tempOutput}"`;
77
+
78
+ await new Promise((resolve, reject) => {
79
+ exec(ffmpegCommand, (err) => err ? reject(err) : resolve());
80
+ });
81
+
82
+ const webpBuffer = fs.readFileSync(tempOutput);
83
+
84
+ const img = new webp.Image();
85
+ await img.load(webpBuffer);
86
+
87
+ const metadata = {
88
+ "sticker-pack-id": crypto.randomBytes(32).toString("hex"),
89
+ "sticker-pack-name": pushname,
90
+ "emojis": sticker.emoji ? [sticker.emoji] : ["🤖"]
91
+ };
92
+
93
+ const exifAttr = Buffer.from([
94
+ 0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00,
95
+ 0x01, 0x00, 0x41, 0x57, 0x07, 0x00, 0x00, 0x00,
96
+ 0x00, 0x00, 0x16, 0x00, 0x00, 0x00
97
+ ]);
98
+
99
+ const jsonBuffer = Buffer.from(JSON.stringify(metadata), "utf8");
100
+ const exif = Buffer.concat([exifAttr, jsonBuffer]);
101
+ exif.writeUIntLE(jsonBuffer.length, 14, 4);
102
+
103
+ img.exif = exif;
104
+
105
+ const finalBuffer = await img.save(null);
106
+
107
+ await sock.sendMessage(chatId, { sticker: finalBuffer });
108
+
109
+ successCount++;
110
+ await delay(800);
111
+
112
+ fs.unlinkSync(tempInput);
113
+ fs.unlinkSync(tempOutput);
114
+
115
+ } catch (err) {
116
+ console.error(`❌ Error on sticker ${i}`, err);
117
+ continue;
118
+ }
119
+ }
120
+
121
+ await sock.sendMessage(chatId, {
122
+ text: `✅ Successfully downloaded ${successCount}/${stickerSet.result.stickers.length} stickers!`
123
+ });
124
+
125
+ } catch (error) {
126
+ console.error('❌ stickerTelegramCommand Error:', error);
127
+ await sock.sendMessage(chatId, {
128
+ text: '❌ Failed to process Telegram stickers.\nCheck the link and try again.'
129
+ });
130
+ }
131
+ }
132
+
133
+ module.exports = stickerTelegramCommand;
@@ -0,0 +1,76 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { downloadMediaMessage } = require('@whiskeysockets/baileys');
4
+ const webp = require('node-webpmux');
5
+ const crypto = require('crypto');
6
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
7
+ async function takeCommand(sock, chatId, message, args) {
8
+ const fkontak = createFakeContact(message);
9
+
10
+ try {
11
+ const pushname = message.pushName || "Unknown User";
12
+ const quotedMessage = message.message?.extendedTextMessage?.contextInfo?.quotedMessage;
13
+
14
+ if (!quotedMessage?.stickerMessage) {
15
+ await sock.sendMessage(chatId, { text: 'Reply to a sticker with .take <packname>' }, { quoted: fkontak });
16
+ return;
17
+ }
18
+
19
+ const packname = args.join(' ') || `${pushname}`;
20
+
21
+ try {
22
+ const stickerBuffer = await downloadMediaMessage(
23
+ {
24
+ key: message.message.extendedTextMessage.contextInfo.stanzaId,
25
+ message: quotedMessage,
26
+ messageType: 'stickerMessage'
27
+ },
28
+ 'buffer',
29
+ {},
30
+ {
31
+ logger: console,
32
+ reuploadRequest: sock.updateMediaMessage
33
+ }
34
+ );
35
+
36
+ if (!stickerBuffer) {
37
+ await sock.sendMessage(chatId, { text: 'Failed to download sticker' }, { quoted: fkontak });
38
+ return;
39
+ }
40
+
41
+ const img = new webp.Image();
42
+ await img.load(stickerBuffer);
43
+
44
+ const json = {
45
+ 'sticker-pack-id': crypto.randomBytes(32).toString('hex'),
46
+ 'sticker-pack-name': packname,
47
+ 'emojis': ['🤖']
48
+ };
49
+
50
+ const exifAttr = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00]);
51
+ const jsonBuffer = Buffer.from(JSON.stringify(json), 'utf8');
52
+ const exif = Buffer.concat([exifAttr, jsonBuffer]);
53
+ exif.writeUIntLE(jsonBuffer.length, 14, 4);
54
+
55
+ img.exif = exif;
56
+
57
+ const finalBuffer = await img.save(null);
58
+
59
+ await sock.sendMessage(chatId, {
60
+ sticker: finalBuffer
61
+ }, {
62
+ quoted: fkontak
63
+ });
64
+
65
+ } catch (error) {
66
+ console.error('Sticker error:', error);
67
+ await sock.sendMessage(chatId, { text: 'Error processing sticker' }, { quoted: fkontak });
68
+ }
69
+
70
+ } catch (error) {
71
+ console.error('Take command error:', error);
72
+ await sock.sendMessage(chatId, { text: 'Command error' }, { quoted: fkontak });
73
+ }
74
+ }
75
+
76
+ module.exports = takeCommand;
@@ -0,0 +1,106 @@
1
+ const axios = require('axios');
2
+ const mumaker = require('mumaker');
3
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
4
+
5
+ const channelInfo = {};
6
+
7
+ const messageTemplates = {
8
+ error: (message) => ({
9
+ text: message
10
+ }),
11
+ success: (text, imageUrl) => ({
12
+ image: { url: imageUrl },
13
+ caption: ""
14
+ })
15
+ };
16
+
17
+ async function textmakerCommand(sock, chatId, message, q, type) {
18
+ try {
19
+ if (!q) {
20
+ return await sock.sendMessage(chatId, messageTemplates.error("Please provide text to generate\nExample: .metallic Supreme"));
21
+ }
22
+
23
+ // Extract text
24
+ const text = q.split(' ').slice(1).join(' ');
25
+
26
+ if (!text) {
27
+ return await sock.sendMessage(chatId, messageTemplates.error("Please provide text to generate\nExample: .metallic Supreme"));
28
+ }
29
+
30
+ try {
31
+ let result;
32
+ switch (type) {
33
+ case 'metallic':
34
+ result = await mumaker.ephoto("https://en.ephoto360.com/impressive-decorative-3d-metal-text-effect-798.html", text);
35
+ break;
36
+ case 'ice':
37
+ result = await mumaker.ephoto("https://en.ephoto360.com/ice-text-effect-online-101.html", text);
38
+ break;
39
+ case 'snow':
40
+ result = await mumaker.ephoto("https://en.ephoto360.com/create-a-snow-3d-text-effect-free-online-621.html", text);
41
+ break;
42
+ case 'impressive':
43
+ result = await mumaker.ephoto("https://en.ephoto360.com/create-3d-colorful-paint-text-effect-online-801.html", text);
44
+ break;
45
+ case 'matrix':
46
+ result = await mumaker.ephoto("https://en.ephoto360.com/matrix-text-effect-154.html", text);
47
+ break;
48
+ case 'light':
49
+ result = await mumaker.ephoto("https://en.ephoto360.com/light-text-effect-futuristic-technology-style-648.html", text);
50
+ break;
51
+ case 'neon':
52
+ result = await mumaker.ephoto("https://en.ephoto360.com/create-colorful-neon-light-text-effects-online-797.html", text);
53
+ break;
54
+ case 'devil':
55
+ result = await mumaker.ephoto("https://en.ephoto360.com/neon-devil-wings-text-effect-online-683.html", text);
56
+ break;
57
+ case 'purple':
58
+ result = await mumaker.ephoto("https://en.ephoto360.com/purple-text-effect-online-100.html", text);
59
+ break;
60
+ case 'thunder':
61
+ result = await mumaker.ephoto("https://en.ephoto360.com/thunder-text-effect-online-97.html", text);
62
+ break;
63
+ case 'leaves':
64
+ result = await mumaker.ephoto("https://en.ephoto360.com/green-brush-text-effect-typography-maker-online-153.html", text);
65
+ break;
66
+ case '1917':
67
+ result = await mumaker.ephoto("https://en.ephoto360.com/1917-style-text-effect-523.html", text);
68
+ break;
69
+ case 'arena':
70
+ result = await mumaker.ephoto("https://en.ephoto360.com/create-cover-arena-of-valor-by-mastering-360.html", text);
71
+ break;
72
+ case 'hacker':
73
+ result = await mumaker.ephoto("https://en.ephoto360.com/create-anonymous-hacker-avatars-cyan-neon-677.html", text);
74
+ break;
75
+ case 'sand':
76
+ result = await mumaker.ephoto("https://en.ephoto360.com/write-names-and-messages-on-the-sand-online-582.html", text);
77
+ break;
78
+ case 'blackpink':
79
+ result = await mumaker.ephoto("https://en.ephoto360.com/create-a-blackpink-style-logo-with-members-signatures-810.html", text);
80
+ break;
81
+ case 'glitch':
82
+ result = await mumaker.ephoto("https://en.ephoto360.com/create-digital-glitch-text-effects-online-767.html", text);
83
+ break;
84
+ case 'fire':
85
+ result = await mumaker.ephoto("https://en.ephoto360.com/flame-lettering-effect-372.html", text);
86
+ break;
87
+ default:
88
+ return await sock.sendMessage(chatId, messageTemplates.error("Invalid text generator type"));
89
+ }
90
+
91
+ if (!result || !result.image) {
92
+ throw new Error('No image URL received from the API');
93
+ }
94
+
95
+ await sock.sendMessage(chatId, messageTemplates.success(text, result.image));
96
+ } catch (error) {
97
+ console.error('Error in text generator:', error);
98
+ await sock.sendMessage(chatId, messageTemplates.error(`Error: ${error.message}`));
99
+ }
100
+ } catch (error) {
101
+ console.error('Error in textmaker command:', error);
102
+ await sock.sendMessage(chatId, messageTemplates.error("An error occurred. Please try again later."));
103
+ }
104
+ }
105
+
106
+ module.exports = textmakerCommand;
@@ -0,0 +1,180 @@
1
+ const { downloadContentFromMessage } = require('@whiskeysockets/baileys');
2
+ const ffmpeg = require('fluent-ffmpeg');
3
+ const fs = require('fs').promises;
4
+ const { tmpdir } = require('os');
5
+ const path = require('path');
6
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
7
+ async function toAudioCommand(sock, chatId, message) {
8
+ const fkontak = createFakeContact(message);
9
+ let inputPath = '';
10
+ let outputPath = '';
11
+
12
+ try {
13
+ const quotedMsg = message.message?.extendedTextMessage?.contextInfo?.quotedMessage;
14
+ let msg = null;
15
+
16
+ if (quotedMsg) {
17
+ msg = quotedMsg.videoMessage || quotedMsg.audioMessage || quotedMsg.documentMessage;
18
+ } else {
19
+ msg = message.message?.videoMessage || message.message?.audioMessage || message.message?.documentMessage;
20
+ }
21
+
22
+ if (!msg) {
23
+ await sock.sendMessage(chatId, {
24
+ text: "Reply to a video or audio file to convert."
25
+ }, { quoted: fkontak });
26
+ return;
27
+ }
28
+
29
+ const mime = msg.mimetype || '';
30
+ const isVideo = mime.startsWith('video/');
31
+ const isAudio = mime.startsWith('audio/');
32
+ const isDocument = msg.documentMessage && (
33
+ mime.includes('video') ||
34
+ mime.includes('audio') ||
35
+ mime.includes('mp4') ||
36
+ mime.includes('mpeg')
37
+ );
38
+
39
+ if (!isVideo && !isAudio && !isDocument) {
40
+ await sock.sendMessage(chatId, {
41
+ text: "Works on video or audio only."
42
+ }, { quoted: fkontak });
43
+ return;
44
+ }
45
+
46
+ await sock.sendMessage(chatId, { text: "Converting..." }, { quoted: fkontak });
47
+
48
+ const fileType = isVideo ? 'video' : 'audio';
49
+
50
+ let stream;
51
+ try {
52
+ stream = await downloadContentFromMessage(msg, fileType);
53
+ } catch (downloadErr) {
54
+ console.error('Download error:', downloadErr);
55
+ throw new Error(`Download failed: ${downloadErr.message}`);
56
+ }
57
+
58
+ const tempDir = tmpdir();
59
+ const timestamp = Date.now();
60
+ const random = Math.random().toString(36).substring(7);
61
+
62
+ const inputExt = mime.includes('mp4') ? 'mp4' :
63
+ mime.includes('webm') ? 'webm' :
64
+ mime.includes('ogg') ? 'ogg' :
65
+ isVideo ? 'mp4' : 'temp';
66
+
67
+ inputPath = path.join(tempDir, `input_${timestamp}_${random}.${inputExt}`);
68
+ outputPath = path.join(tempDir, `output_${timestamp}_${random}.mp3`);
69
+
70
+ const writeStream = require('fs').createWriteStream(inputPath);
71
+
72
+ await new Promise((resolve, reject) => {
73
+ stream.on('data', (chunk) => {
74
+ writeStream.write(chunk);
75
+ });
76
+
77
+ stream.on('end', () => {
78
+ writeStream.end();
79
+ resolve();
80
+ });
81
+
82
+ stream.on('error', (err) => {
83
+ writeStream.end();
84
+ reject(err);
85
+ });
86
+
87
+ writeStream.on('error', reject);
88
+ });
89
+
90
+ const stats = await fs.stat(inputPath);
91
+ if (stats.size === 0) {
92
+ throw new Error('File empty');
93
+ }
94
+
95
+ // Convert using ffmpeg
96
+ await new Promise((resolve, reject) => {
97
+ const command = ffmpeg(inputPath)
98
+ .toFormat('mp3')
99
+ .audioCodec('libmp3lame')
100
+ .audioBitrate('192k')
101
+ .audioChannels(2)
102
+ .audioFrequency(44100)
103
+ .on('end', () => {
104
+ resolve();
105
+ })
106
+ .on('error', (err) => {
107
+ console.error('FFmpeg error:', err.message);
108
+ reject(new Error(`Conversion failed`));
109
+ })
110
+ .save(outputPath);
111
+
112
+ setTimeout(() => {
113
+ if (command && command.ffmpegProc && !command.ffmpegProc.killed) {
114
+ command.kill('SIGKILL');
115
+ reject(new Error('Timeout'));
116
+ }
117
+ }, 60000);
118
+ });
119
+
120
+ const audioStats = await fs.stat(outputPath);
121
+ if (audioStats.size === 0) {
122
+ throw new Error('Output empty');
123
+ }
124
+
125
+ const audioBuffer = await fs.readFile(outputPath);
126
+
127
+ const maxSize = 15 * 1024 * 1024;
128
+ if (audioBuffer.length > maxSize) {
129
+ console.warn(`File large: ${(audioBuffer.length / 1024 / 1024).toFixed(2)}MB`);
130
+ }
131
+
132
+ // Send converted audio
133
+ await sock.sendMessage(chatId, {
134
+ audio: audioBuffer,
135
+ mimetype: 'audio/mpeg',
136
+ ptt: false,
137
+ fileName: `audio_${timestamp}.mp3`
138
+ }, { quoted: fkontak });
139
+
140
+ } catch (err) {
141
+ console.error("toAudio error:", err.message);
142
+
143
+ let errorMessage = "Conversion failed.";
144
+
145
+ if (err.message.includes('FFmpeg') || err.message.includes('conversion')) {
146
+ errorMessage = "FFmpeg error. Check install.";
147
+ } else if (err.message.includes('timeout')) {
148
+ errorMessage = "Timeout. Try shorter video.";
149
+ } else if (err.message.includes('empty')) {
150
+ errorMessage = "File empty or invalid.";
151
+ } else if (err.message.includes('download')) {
152
+ errorMessage = "Download failed.";
153
+ }
154
+
155
+ await sock.sendMessage(chatId, { text: errorMessage }, { quoted: fkontak });
156
+
157
+ } finally {
158
+ const cleanupPromises = [];
159
+
160
+ if (inputPath) {
161
+ cleanupPromises.push(
162
+ fs.unlink(inputPath).catch(err =>
163
+ console.error(`Delete failed ${inputPath}:`, err.message)
164
+ )
165
+ );
166
+ }
167
+
168
+ if (outputPath) {
169
+ cleanupPromises.push(
170
+ fs.unlink(outputPath).catch(err =>
171
+ console.error(`Delete failed ${outputPath}:`, err.message)
172
+ )
173
+ );
174
+ }
175
+
176
+ await Promise.allSettled(cleanupPromises);
177
+ }
178
+ }
179
+
180
+ module.exports = toAudioCommand;
@@ -0,0 +1,33 @@
1
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
2
+ const { downloadMediaMessage } = require('@whiskeysockets/baileys');
3
+
4
+ async function togifCommand(sock, chatId, message) {
5
+ const fakeContact = createFakeContact(message);
6
+ const botName = getBotName();
7
+
8
+ const quotedMsg = message.message?.extendedTextMessage?.contextInfo?.quotedMessage;
9
+ if (!quotedMsg) {
10
+ return sock.sendMessage(chatId, { text: `*${botName}*\nReply to a video or animated sticker with .togif` }, { quoted: fakeContact });
11
+ }
12
+
13
+ const isVideo = quotedMsg.videoMessage;
14
+ const isSticker = quotedMsg.stickerMessage;
15
+
16
+ if (!isVideo && !isSticker) {
17
+ return sock.sendMessage(chatId, { text: `*${botName}*\nReply to a video or animated sticker only.` }, { quoted: fakeContact });
18
+ }
19
+
20
+ await sock.sendMessage(chatId, { react: { text: '🔄', key: message.key } });
21
+
22
+ try {
23
+ const buffer = await downloadMediaMessage({ message: quotedMsg }, 'buffer', {});
24
+ if (buffer) {
25
+ await sock.sendMessage(chatId, { video: buffer, gifPlayback: true, caption: `*${botName}*\nConverted to GIF` }, { quoted: fakeContact });
26
+ await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
27
+ }
28
+ } catch (err) {
29
+ await sock.sendMessage(chatId, { text: `*${botName}*\nConversion failed: ${err.message}` }, { quoted: fakeContact });
30
+ }
31
+ }
32
+
33
+ module.exports = { togifCommand };
@@ -0,0 +1,26 @@
1
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
2
+ const { downloadMediaMessage } = require('@whiskeysockets/baileys');
3
+
4
+ async function toimgCommand(sock, chatId, message) {
5
+ const fakeContact = createFakeContact(message);
6
+ const botName = getBotName();
7
+
8
+ const quotedMsg = message.message?.extendedTextMessage?.contextInfo?.quotedMessage;
9
+ if (!quotedMsg?.stickerMessage) {
10
+ return sock.sendMessage(chatId, { text: `*${botName}*\nReply to a sticker with .toimg to convert it to an image.` }, { quoted: fakeContact });
11
+ }
12
+
13
+ await sock.sendMessage(chatId, { react: { text: '🔄', key: message.key } });
14
+
15
+ try {
16
+ const buffer = await downloadMediaMessage({ message: quotedMsg }, 'buffer', {});
17
+ if (buffer) {
18
+ await sock.sendMessage(chatId, { image: buffer, caption: `*${botName}*\nSticker converted to image` }, { quoted: fakeContact });
19
+ await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
20
+ }
21
+ } catch (err) {
22
+ await sock.sendMessage(chatId, { text: `*${botName}*\nConversion failed: ${err.message}` }, { quoted: fakeContact });
23
+ }
24
+ }
25
+
26
+ module.exports = toimgCommand;
@@ -0,0 +1,34 @@
1
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
2
+ const { downloadMediaMessage } = require('@whiskeysockets/baileys');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ async function tomp4Command(sock, chatId, message) {
7
+ const fakeContact = createFakeContact(message);
8
+ const botName = getBotName();
9
+
10
+ const quotedMsg = message.message?.extendedTextMessage?.contextInfo?.quotedMessage;
11
+ if (!quotedMsg) {
12
+ return sock.sendMessage(chatId, { text: `*${botName}*\nReply to a sticker or GIF with .tomp4` }, { quoted: fakeContact });
13
+ }
14
+
15
+ const isStickerOrGif = quotedMsg.stickerMessage || (quotedMsg.videoMessage && quotedMsg.videoMessage.gifPlayback) || quotedMsg.imageMessage?.mimetype?.includes('webp');
16
+
17
+ if (!isStickerOrGif) {
18
+ return sock.sendMessage(chatId, { text: `*${botName}*\nReply to an animated sticker or GIF only.` }, { quoted: fakeContact });
19
+ }
20
+
21
+ await sock.sendMessage(chatId, { react: { text: '🔄', key: message.key } });
22
+
23
+ try {
24
+ const buffer = await downloadMediaMessage({ message: quotedMsg }, 'buffer', {});
25
+ if (buffer) {
26
+ await sock.sendMessage(chatId, { video: buffer, gifPlayback: false, caption: `*${botName}*\nConverted to MP4` }, { quoted: fakeContact });
27
+ await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
28
+ }
29
+ } catch (err) {
30
+ await sock.sendMessage(chatId, { text: `*${botName}*\nConversion failed: ${err.message}` }, { quoted: fakeContact });
31
+ }
32
+ }
33
+
34
+ module.exports = { tomp4Command };