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,45 @@
1
+ const isAdmin = require('../../davelib/isAdmin');
2
+ const db = require('../../Database/database');
3
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
4
+
5
+ async function unmuteCommand(sock, chatId, message) {
6
+ const senderId = message.key.participant || message.key.remoteJid;
7
+ const fake = createFakeContact(senderId);
8
+ const botName = getBotName();
9
+
10
+ const { isSenderAdmin, isBotAdmin } = await isAdmin(sock, chatId, senderId);
11
+
12
+ if (!isBotAdmin) {
13
+ await sock.sendMessage(chatId, { text: `*${botName}*\nBot needs admin!` }, { quoted: fake });
14
+ return { success: false, message: 'Bot not admin' };
15
+ }
16
+
17
+ if (!isSenderAdmin && !message?.key?.fromMe && !db.isSudo(senderId)) {
18
+ await sock.sendMessage(chatId, { text: `*${botName}*\nAdmin only command!` }, { quoted: fake });
19
+ return { success: false, message: 'Not authorized' };
20
+ }
21
+
22
+ try {
23
+ await sock.groupSettingUpdate(chatId, 'not_announcement');
24
+
25
+ const metadata = await sock.groupMetadata(chatId);
26
+ const groupName = metadata?.subject || 'Group';
27
+
28
+ await sock.sendMessage(chatId, {
29
+ text: `*${botName}*\n\n${groupName} has been unmuted.`
30
+ }, { quoted: fake });
31
+
32
+ return { success: true, message: `${groupName} unmuted` };
33
+
34
+ } catch (error) {
35
+ console.error('Unmute error:', error.message, 'Line:', error.stack?.split('\n')[1]);
36
+
37
+ await sock.sendMessage(chatId, {
38
+ text: `*${botName}*\nFailed to unmute.`
39
+ }, { quoted: fake });
40
+
41
+ return { success: false, message: 'Failed', error };
42
+ }
43
+ }
44
+
45
+ module.exports = unmuteCommand;
@@ -0,0 +1,83 @@
1
+ const isAdmin = require('../../davelib/isAdmin');
2
+ const db = require('../../Database/database');
3
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
4
+
5
+ async function warnCommand(sock, chatId, senderId, mentionedJids, message) {
6
+ try {
7
+ const fake = createFakeContact(senderId);
8
+ const botName = getBotName();
9
+
10
+ if (!chatId.endsWith('@g.us')) {
11
+ await sock.sendMessage(chatId, {
12
+ text: `*${botName}*\nGroup command only!`
13
+ }, { quoted: fake });
14
+ return;
15
+ }
16
+
17
+ const { isSenderAdmin, isBotAdmin } = await isAdmin(sock, chatId, senderId);
18
+
19
+ if (!isBotAdmin) {
20
+ await sock.sendMessage(chatId, {
21
+ text: `*${botName}*\nBot needs to be admin!`
22
+ }, { quoted: fake });
23
+ return;
24
+ }
25
+
26
+ if (!isSenderAdmin && !message.key.fromMe && !db.isSudo(senderId)) {
27
+ await sock.sendMessage(chatId, {
28
+ text: `*${botName}*\nAdmin only command!`
29
+ }, { quoted: fake });
30
+ return;
31
+ }
32
+
33
+ let userToWarn;
34
+
35
+ if (mentionedJids && mentionedJids.length > 0) {
36
+ userToWarn = mentionedJids[0];
37
+ } else if (message.message?.extendedTextMessage?.contextInfo?.participant) {
38
+ userToWarn = message.message.extendedTextMessage.contextInfo.participant;
39
+ }
40
+
41
+ if (!userToWarn) {
42
+ await sock.sendMessage(chatId, {
43
+ text: `*${botName}*\nMention or reply to a user to warn them.`
44
+ }, { quoted: fake });
45
+ return;
46
+ }
47
+
48
+ const targetAdmin = await isAdmin(sock, chatId, userToWarn);
49
+ if (targetAdmin.isSenderAdmin) {
50
+ await sock.sendMessage(chatId, {
51
+ text: `*${botName}*\nCannot warn an admin!`
52
+ }, { quoted: fake });
53
+ return;
54
+ }
55
+
56
+ const warnCount = db.incrementWarning(chatId, userToWarn);
57
+ const maxWarnings = 3;
58
+ const userTag = `@${userToWarn.split('@')[0]}`;
59
+
60
+ if (warnCount >= maxWarnings) {
61
+ await sock.sendMessage(chatId, {
62
+ text: `*${botName}*\n${userTag} has been kicked!\nReason: ${maxWarnings} warnings`,
63
+ mentions: [userToWarn]
64
+ }, { quoted: fake });
65
+
66
+ try {
67
+ await sock.groupParticipantsUpdate(chatId, [userToWarn], 'remove');
68
+ db.resetWarning(chatId, userToWarn);
69
+ } catch (kickError) {
70
+ console.error('Kick error:', kickError.message, 'Line:', kickError.stack?.split('\n')[1]);
71
+ }
72
+ } else {
73
+ await sock.sendMessage(chatId, {
74
+ text: `*${botName}*\n${userTag} has been warned!\nWarnings: ${warnCount}/${maxWarnings}`,
75
+ mentions: [userToWarn]
76
+ }, { quoted: fake });
77
+ }
78
+ } catch (error) {
79
+ console.error('Error in warn command:', error.message, 'Line:', error.stack?.split('\n')[1]);
80
+ }
81
+ }
82
+
83
+ module.exports = warnCommand;
@@ -0,0 +1,26 @@
1
+ const db = require('../../Database/database');
2
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
3
+
4
+ async function warningsCommand(sock, chatId, mentionedJidList, groupId) {
5
+ if (mentionedJidList.length === 0) {
6
+ await sock.sendMessage(chatId, { text: 'Please mention a user to check warnings.' });
7
+ return;
8
+ }
9
+
10
+ const userToCheck = mentionedJidList[0];
11
+ const targetGroup = groupId || chatId;
12
+
13
+ try {
14
+ const database = db.getDb();
15
+ const stmt = database.prepare('SELECT count FROM warnings WHERE group_jid = ? AND user_jid = ?');
16
+ const result = stmt.get(targetGroup, userToCheck);
17
+ const warningCount = result ? result.count : 0;
18
+
19
+ await sock.sendMessage(chatId, { text: `User has ${warningCount} warning(s).` });
20
+ } catch (error) {
21
+ console.error('Error fetching warnings:', error);
22
+ await sock.sendMessage(chatId, { text: 'Error fetching warnings.' });
23
+ }
24
+ }
25
+
26
+ module.exports = warningsCommand;
@@ -0,0 +1,130 @@
1
+ const axios = require('axios');
2
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
3
+
4
+ const ANIMU_BASE = 'https://api.some-random-api.com/animu';
5
+
6
+ function normalizeType(input) {
7
+ const lower = (input || '').toLowerCase();
8
+ if (lower === 'facepalm' || lower === 'face_palm') return 'face-palm';
9
+ if (lower === 'quote' || lower === 'animu-quote' || lower === 'animuquote') return 'quote';
10
+ return lower;
11
+ }
12
+
13
+ async function sendAnimu(sock, chatId, message, type) {
14
+ const fakeContact = createFakeContact(message);
15
+ // Handle waifu, neko, and loli from different APIs
16
+ if (type === 'waifu' || type === 'neko') {
17
+ try {
18
+ const endpoint = `https://api.siputzx.my.id/api/r/${type}`;
19
+ const res = await axios.get(endpoint, { responseType: 'arraybuffer' });
20
+
21
+ if (res.status === 200 && res.data) {
22
+ await sock.sendMessage(
23
+ chatId,
24
+ { image: res.data, caption: `anime: ${type}` },
25
+ { quoted: fakeContact }
26
+ );
27
+ return;
28
+ }
29
+ } catch (error) {
30
+ console.error(`Error fetching ${type}:`, error.message);
31
+ await sock.sendMessage(
32
+ chatId,
33
+ { text: `❌ Failed to fetch ${type}.` },
34
+ { quoted: fakeContact }
35
+ );
36
+ return;
37
+ }
38
+ }
39
+
40
+ if (type === 'loli') {
41
+ try {
42
+ const endpoint = 'https://shizoapi.onrender.com/api/sfw/loli?apikey=shizo';
43
+ const res = await axios.get(endpoint, { responseType: 'arraybuffer' });
44
+
45
+ if (res.status === 200 && res.data) {
46
+ await sock.sendMessage(
47
+ chatId,
48
+ { image: res.data, caption: `anime: ${type}` },
49
+ { quoted: fakeContact }
50
+ );
51
+ return;
52
+ }
53
+ } catch (error) {
54
+ console.error(`Error fetching ${type}:`, error.message);
55
+ await sock.sendMessage(
56
+ chatId,
57
+ { text: `❌ Failed to fetch ${type}.` },
58
+ { quoted: fakeContact }
59
+ );
60
+ return;
61
+ }
62
+ }
63
+
64
+ // Handle other anime types from some-random-api
65
+ const endpoint = `${ANIMU_BASE}/${type}`;
66
+ const res = await axios.get(endpoint);
67
+ const data = res.data || {};
68
+
69
+ // Prefer link (gif/image). Fallback to text quote if available
70
+ if (data.link) {
71
+ await sock.sendMessage(
72
+ chatId,
73
+ { image: { url: data.link }, caption: `anime: ${type}` },
74
+ { quoted: fakeContact }
75
+ );
76
+ return;
77
+ }
78
+ if (data.quote) {
79
+ await sock.sendMessage(
80
+ chatId,
81
+ { text: data.quote },
82
+ { quoted: fakeContact }
83
+ );
84
+ return;
85
+ }
86
+
87
+ await sock.sendMessage(
88
+ chatId,
89
+ { text: '❌ Failed to fetch animu.' },
90
+ { quoted: fakeContact }
91
+ );
92
+ }
93
+
94
+ async function animeCommand(sock, chatId, message, args) {
95
+ const fakeContact = createFakeContact(message);
96
+ const subArg = args && args[0] ? args[0] : '';
97
+ const sub = normalizeType(subArg);
98
+
99
+ const supported = [
100
+ 'nom', 'poke', 'cry', 'kiss', 'pat', 'hug', 'wink', 'face-palm', 'quote', 'waifu', 'neko', 'loli'
101
+ ];
102
+
103
+ try {
104
+ if (!sub) {
105
+ // Fetch supported types from API for dynamic help
106
+ try {
107
+ const res = await axios.get(ANIMU_BASE);
108
+ const apiTypes = res.data && res.data.types ? res.data.types.map(s => s.replace('/animu/', '')).join(', ') : supported.join(', ');
109
+ await sock.sendMessage(chatId, { text: `Usage: .animu <type>\nTypes: ${apiTypes}` }, { quoted: fakeContact });
110
+ } catch {
111
+ await sock.sendMessage(chatId, { text: `Usage: .animu <type>\nTypes: ${supported.join(', ')}` }, { quoted: fakeContact });
112
+ }
113
+ return;
114
+ }
115
+
116
+ if (!supported.includes(sub)) {
117
+ await sock.sendMessage(chatId, { text: `❌ Unsupported type: ${sub}. Try one of: ${supported.join(', ')}` }, { quoted: fakeContact });
118
+ return;
119
+ }
120
+
121
+ await sendAnimu(sock, chatId, message, sub);
122
+ } catch (err) {
123
+ console.error('Error in animu command:', err);
124
+ await sock.sendMessage(chatId, { text: '❌ An error occurred while fetching animu.' }, { quoted: fakeContact });
125
+ }
126
+ }
127
+
128
+ module.exports = { animeCommand };
129
+
130
+
@@ -0,0 +1,127 @@
1
+ const { spawn } = require('child_process');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const { writeExifImg, writeExifVid } = require('../../davelib/exif');
5
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
6
+ async function attpCommand(sock, chatId, message) {
7
+ const userMessage = message.message.conversation || message.message.extendedTextMessage?.text || '';
8
+ const text = userMessage.split(' ').slice(1).join(' ');
9
+
10
+ const fake = createFakeContact(message);
11
+
12
+ if (!text) {
13
+ await sock.sendMessage(chatId, { text: 'Please provide text after the .attp command.' }, { quoted: fake });
14
+ return;
15
+ }
16
+
17
+ try {
18
+ const pushname = message.pushName || 'DAVE-X'
19
+ const mp4Buffer = await renderBlinkingVideoWithFfmpeg(text);
20
+ const webpPath = await writeExifVid(mp4Buffer, { packname: `${pushname}` });
21
+ const webpBuffer = fs.readFileSync(webpPath);
22
+ try { fs.unlinkSync(webpPath) } catch (_) {}
23
+ await sock.sendMessage(chatId, { sticker: webpBuffer }, { quoted: fake });
24
+ } catch (error) {
25
+ console.error('Error generating local sticker:', error);
26
+ await sock.sendMessage(chatId, { text: 'Failed to generate the sticker.' }, { quoted: fake });
27
+ }
28
+ }
29
+
30
+ module.exports = attpCommand;
31
+
32
+ function renderTextToPngWithFfmpeg(text) {
33
+ return new Promise((resolve, reject) => {
34
+ const fontPath = process.platform === 'win32'
35
+ ? 'C:/Windows/Fonts/arialbd.ttf'
36
+ : '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf';
37
+
38
+ const escapeDrawtextText = (s) => s
39
+ .replace(/\\/g, '\\\\')
40
+ .replace(/:/g, '\\:')
41
+ .replace(/'/g, "\\'")
42
+ .replace(/\[/g, '\\[')
43
+ .replace(/\]/g, '\\]')
44
+ .replace(/%/g, '\\%');
45
+
46
+ const safeText = escapeDrawtextText(text);
47
+ const safeFontPath = process.platform === 'win32'
48
+ ? fontPath.replace(/\\/g, '/').replace(':', '\\:')
49
+ : fontPath;
50
+
51
+ const args = [
52
+ '-y',
53
+ '-f', 'lavfi',
54
+ '-i', 'color=c=#00000000:s=512x512',
55
+ '-vf', `drawtext=fontfile='${safeFontPath}':text='${safeText}':fontcolor=white:fontsize=56:borderw=2:bordercolor=black@0.6:x=(w-text_w)/2:y=(h-text_h)/2`,
56
+ '-frames:v', '1',
57
+ '-f', 'image2',
58
+ 'pipe:1'
59
+ ];
60
+
61
+ const ff = spawn('ffmpeg', args);
62
+ const chunks = [];
63
+ const errors = [];
64
+ ff.stdout.on('data', d => chunks.push(d));
65
+ ff.stderr.on('data', e => errors.push(e));
66
+ ff.on('error', reject);
67
+ ff.on('close', code => {
68
+ if (code === 0) return resolve(Buffer.concat(chunks));
69
+ reject(new Error(Buffer.concat(errors).toString() || `ffmpeg exited with code ${code}`));
70
+ });
71
+ });
72
+ }
73
+
74
+ function renderBlinkingVideoWithFfmpeg(text) {
75
+ return new Promise((resolve, reject) => {
76
+ const fontPath = process.platform === 'win32'
77
+ ? 'C:/Windows/Fonts/arialbd.ttf'
78
+ : '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf';
79
+
80
+ const escapeDrawtextText = (s) => s
81
+ .replace(/\\/g, '\\\\')
82
+ .replace(/:/g, '\\:')
83
+ .replace(/,/g, '\\,')
84
+ .replace(/'/g, "\\'")
85
+ .replace(/\[/g, '\\[')
86
+ .replace(/\]/g, '\\]')
87
+ .replace(/%/g, '\\%');
88
+
89
+ const safeText = escapeDrawtextText(text);
90
+ const safeFontPath = process.platform === 'win32'
91
+ ? fontPath.replace(/\\/g, '/').replace(':', '\\:')
92
+ : fontPath;
93
+
94
+ const cycle = 0.3;
95
+ const dur = 1.8;
96
+
97
+ const drawRed = `drawtext=fontfile='${safeFontPath}':text='${safeText}':fontcolor=red:borderw=2:bordercolor=black@0.6:fontsize=56:x=(w-text_w)/2:y=(h-text_h)/2:enable='lt(mod(t\,${cycle})\,0.1)'`;
98
+ const drawBlue = `drawtext=fontfile='${safeFontPath}':text='${safeText}':fontcolor=blue:borderw=2:bordercolor=black@0.6:fontsize=56:x=(w-text_w)/2:y=(h-text_h)/2:enable='between(mod(t\,${cycle})\,0.1\,0.2)'`;
99
+ const drawGreen = `drawtext=fontfile='${safeFontPath}':text='${safeText}':fontcolor=green:borderw=2:bordercolor=black@0.6:fontsize=56:x=(w-text_w)/2:y=(h-text_h)/2:enable='gte(mod(t\,${cycle})\,0.2)'`;
100
+
101
+ const filter = `${drawRed},${drawBlue},${drawGreen}`;
102
+
103
+ const args = [
104
+ '-y',
105
+ '-f', 'lavfi',
106
+ '-i', `color=c=black:s=512x512:d=${dur}:r=20`,
107
+ '-vf', filter,
108
+ '-c:v', 'libx264',
109
+ '-pix_fmt', 'yuv420p',
110
+ '-movflags', '+faststart+frag_keyframe+empty_moov',
111
+ '-t', String(dur),
112
+ '-f', 'mp4',
113
+ 'pipe:1'
114
+ ];
115
+
116
+ const ff = spawn('ffmpeg', args);
117
+ const chunks = [];
118
+ const errors = [];
119
+ ff.stdout.on('data', d => chunks.push(d));
120
+ ff.stderr.on('data', e => errors.push(e));
121
+ ff.on('error', reject);
122
+ ff.on('close', code => {
123
+ if (code === 0) return resolve(Buffer.concat(chunks));
124
+ reject(new Error(Buffer.concat(errors).toString() || `ffmpeg exited with code ${code}`));
125
+ });
126
+ });
127
+ }
@@ -0,0 +1,52 @@
1
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
2
+ const axios = require('axios');
3
+
4
+ async function logoCommand(sock, chatId, message, args) {
5
+ const fakeContact = createFakeContact(message);
6
+ const botName = getBotName();
7
+ const text = args.join(' ').trim();
8
+
9
+ if (!text) {
10
+ return sock.sendMessage(chatId, { text: `*${botName} LOGO MAKER*\n\nUsage: .logo <text>\nMakes a styled logo from your text` }, { quoted: fakeContact });
11
+ }
12
+
13
+ await sock.sendMessage(chatId, { react: { text: '🎨', key: message.key } });
14
+
15
+ try {
16
+ const res = await axios.get(`https://api.siputzx.my.id/api/m/ephoto?url=https://en.ephoto360.com/create-3d-hologram-text-effect-online-free-697.html&text=${encodeURIComponent(text)}`, { timeout: 20000 });
17
+ const imgUrl = res.data?.result || res.data?.url || res.data?.data?.url;
18
+ if (imgUrl) {
19
+ await sock.sendMessage(chatId, { image: { url: imgUrl }, caption: `*${botName} LOGO*\nText: ${text}` }, { quoted: fakeContact });
20
+ } else {
21
+ await sock.sendMessage(chatId, { text: `*${botName}*\nFailed to generate logo.` }, { quoted: fakeContact });
22
+ }
23
+ } catch (err) {
24
+ await sock.sendMessage(chatId, { text: `*${botName}*\nError: ${err.message}` }, { quoted: fakeContact });
25
+ }
26
+ }
27
+
28
+ async function carbonCommand(sock, chatId, message, args) {
29
+ const fakeContact = createFakeContact(message);
30
+ const botName = getBotName();
31
+ const code = args.join(' ').trim();
32
+
33
+ if (!code) {
34
+ return sock.sendMessage(chatId, { text: `*${botName} CARBON*\n\nUsage: .carbon <code>\nGenerates a beautiful code screenshot` }, { quoted: fakeContact });
35
+ }
36
+
37
+ await sock.sendMessage(chatId, { react: { text: '💻', key: message.key } });
38
+
39
+ try {
40
+ const res = await axios.get(`https://bk9.fun/tools/carbon?q=${encodeURIComponent(code)}`, { timeout: 20000 });
41
+ const imgUrl = res.data?.BK9 || res.data?.result;
42
+ if (imgUrl) {
43
+ await sock.sendMessage(chatId, { image: { url: imgUrl }, caption: `*${botName} CARBON*` }, { quoted: fakeContact });
44
+ } else {
45
+ await sock.sendMessage(chatId, { text: `*${botName}*\nFailed to generate carbon image.` }, { quoted: fakeContact });
46
+ }
47
+ } catch (err) {
48
+ await sock.sendMessage(chatId, { text: `*${botName}*\nError: ${err.message}` }, { quoted: fakeContact });
49
+ }
50
+ }
51
+
52
+ module.exports = { logoCommand, carbonCommand };
@@ -0,0 +1,105 @@
1
+ const fetch = require('node-fetch');
2
+ const fs = require('fs');
3
+ const { exec } = require('child_process');
4
+ const path = require('path');
5
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
6
+ async function emojimixCommand(sock, chatId, msg) {
7
+ try {
8
+ const fake = createFakeContact(msg);
9
+
10
+ // Get the text after command
11
+ const text = msg.message?.conversation?.trim() ||
12
+ msg.message?.extendedTextMessage?.text?.trim() || '';
13
+
14
+ const args = text.split(' ').slice(1);
15
+
16
+ if (!args[0]) {
17
+ await sock.sendMessage(chatId, { text: 'Example: .emojimix 😎+🥰' }, { quoted: fake });
18
+ return;
19
+ }
20
+
21
+ if (!text.includes('+')) {
22
+ await sock.sendMessage(chatId, {
23
+ text: 'Separate the emoji with a + sign\n\nExample:\n.emojimix 😎+🥰'
24
+ }, { quoted: fake });
25
+ return;
26
+ }
27
+
28
+ let [emoji1, emoji2] = args[0].split('+').map(e => e.trim());
29
+
30
+ // Using Tenor API endpoint
31
+ const url = `https://tenor.googleapis.com/v2/featured?key=AIzaSyAyimkuYQYF_FXVALexPuGQctUWRURdCYQ&contentfilter=high&media_filter=png_transparent&component=proactive&collection=emoji_kitchen_v5&q=${encodeURIComponent(emoji1)}_${encodeURIComponent(emoji2)}`;
32
+
33
+ const response = await fetch(url);
34
+ const data = await response.json();
35
+
36
+ if (!data.results || data.results.length === 0) {
37
+ await sock.sendMessage(chatId, {
38
+ text: 'These emojis cannot be mixed! Try different ones.'
39
+ }, { quoted: fake });
40
+ return;
41
+ }
42
+
43
+ // Get the first result URL
44
+ const imageUrl = data.results[0].url;
45
+
46
+ // Create temp directory if it doesn't exist
47
+ const tmpDir = path.join(process.cwd(), 'tmp');
48
+ if (!fs.existsSync(tmpDir)) {
49
+ fs.mkdirSync(tmpDir, { recursive: true });
50
+ }
51
+
52
+ // Generate random filenames with escaped paths
53
+ const tempFile = path.join(tmpDir, `temp_${Date.now()}.png`).replace(/\\/g, '/');
54
+ const outputFile = path.join(tmpDir, `sticker_${Date.now()}.webp`).replace(/\\/g, '/');
55
+
56
+ // Download and save the image
57
+ const imageResponse = await fetch(imageUrl);
58
+ const buffer = await imageResponse.buffer();
59
+ fs.writeFileSync(tempFile, buffer);
60
+
61
+ // Convert to WebP using ffmpeg with proper path escaping
62
+ const ffmpegCommand = `ffmpeg -i "${tempFile}" -vf "scale=512:512:force_original_aspect_ratio=decrease,format=rgba,pad=512:512:(ow-iw)/2:(oh-ih)/2:color=#00000000" "${outputFile}"`;
63
+
64
+ await new Promise((resolve, reject) => {
65
+ exec(ffmpegCommand, (error) => {
66
+ if (error) {
67
+ console.error('FFmpeg error:', error);
68
+ reject(error);
69
+ } else {
70
+ resolve();
71
+ }
72
+ });
73
+ });
74
+
75
+ // Check if output file exists
76
+ if (!fs.existsSync(outputFile)) {
77
+ throw new Error('Failed to create sticker file');
78
+ }
79
+
80
+ // Read the WebP file
81
+ const stickerBuffer = fs.readFileSync(outputFile);
82
+
83
+ // Send the sticker
84
+ await sock.sendMessage(chatId, {
85
+ sticker: stickerBuffer
86
+ }, { quoted: fake });
87
+
88
+ // Cleanup temp files
89
+ try {
90
+ fs.unlinkSync(tempFile);
91
+ fs.unlinkSync(outputFile);
92
+ } catch (err) {
93
+ console.error('Error cleaning up temp files:', err);
94
+ }
95
+
96
+ } catch (error) {
97
+ console.error('Error in emojimix command:', error);
98
+ const fake = createFakeContact(msg);
99
+ await sock.sendMessage(chatId, {
100
+ text: 'Failed to mix emojis! Make sure you are using valid emojis.\n\nExample: .emojimix 😎+🥰'
101
+ }, { quoted: fake });
102
+ }
103
+ }
104
+
105
+ module.exports = emojimixCommand;
@@ -0,0 +1,108 @@
1
+ const axios = require('axios');
2
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
3
+
4
+ async function getppCommand(sock, chatId, message) {
5
+ try {
6
+ const fake = createFakeContact(message);
7
+ const botName = getBotName();
8
+
9
+ // Check if user is owner
10
+ const isOwner = message.key.fromMe;
11
+ if (!isOwner) {
12
+ const authMsgs = [
13
+ `✦ Owner only command`,
14
+ `✦ Sorry, only the boss can use this`,
15
+ `✦ Privileges required`
16
+ ];
17
+ await sock.sendMessage(chatId, {
18
+ text: authMsgs[Math.floor(Math.random() * authMsgs.length)]
19
+ }, { quoted: fake });
20
+ return;
21
+ }
22
+
23
+ let userToAnalyze;
24
+
25
+ // Check for mentioned users
26
+ if (message.message?.extendedTextMessage?.contextInfo?.mentionedJid?.length > 0) {
27
+ userToAnalyze = message.message.extendedTextMessage.contextInfo.mentionedJid[0];
28
+ }
29
+ // Check for replied message
30
+ else if (message.message?.extendedTextMessage?.contextInfo?.participant) {
31
+ userToAnalyze = message.message.extendedTextMessage.contextInfo.participant;
32
+ }
33
+
34
+ if (!userToAnalyze) {
35
+ const usageMsgs = [
36
+ `✦ Mention someone or reply to their message`,
37
+ `✦ Who's pp? Tag or reply to them`,
38
+ `✦ Please specify a user`
39
+ ];
40
+ await sock.sendMessage(chatId, {
41
+ text: usageMsgs[Math.floor(Math.random() * usageMsgs.length)]
42
+ }, { quoted: fake });
43
+
44
+ await sock.sendMessage(chatId, {
45
+ react: { text: '🗑️', key: message.key }
46
+ });
47
+ return;
48
+ }
49
+
50
+ try {
51
+ // Get user's profile picture
52
+ let profilePic;
53
+ try {
54
+ profilePic = await sock.profilePictureUrl(userToAnalyze, 'image');
55
+ } catch {
56
+ profilePic = 'https://files.catbox.moe/lvcwnf.jpg'; // Default image
57
+ }
58
+
59
+ const username = userToAnalyze.split('@')[0];
60
+
61
+ const captionMsgs = [
62
+ `✦ @${username}'s profile picture`,
63
+ `✦ PP for @${username}`,
64
+ `✦ Here's @${username}`
65
+ ];
66
+
67
+ // Send the profile picture to the chat
68
+ await sock.sendMessage(chatId, {
69
+ image: { url: profilePic },
70
+ caption: captionMsgs[Math.floor(Math.random() * captionMsgs.length)],
71
+ mentions: [userToAnalyze]
72
+ }, { quoted: fake });
73
+
74
+ await sock.sendMessage(chatId, {
75
+ react: { text: '✅', key: message.key }
76
+ });
77
+
78
+ } catch (error) {
79
+ console.error('Error in getpp command:', error);
80
+
81
+ const errorMsgs = [
82
+ `✦ Couldn't fetch that profile`,
83
+ `✦ No profile picture found`,
84
+ `✦ User might not have a pp set`
85
+ ];
86
+
87
+ await sock.sendMessage(chatId, {
88
+ text: errorMsgs[Math.floor(Math.random() * errorMsgs.length)]
89
+ }, { quoted: fake });
90
+ }
91
+ } catch (error) {
92
+ console.error('Unexpected error in getppCommand:', error);
93
+ const fake = createFakeContact(message);
94
+ const botName = getBotName();
95
+
96
+ const fatalMsgs = [
97
+ `✦ Something went wrong`,
98
+ `✦ Unexpected error`,
99
+ `✦ Command failed`
100
+ ];
101
+
102
+ await sock.sendMessage(chatId, {
103
+ text: fatalMsgs[Math.floor(Math.random() * fatalMsgs.length)]
104
+ }, { quoted: fake });
105
+ }
106
+ }
107
+
108
+ module.exports = getppCommand;