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,233 @@
1
+ const fetch = require('node-fetch');
2
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
3
+ async function analyzeCommand(sock, chatId, message, text, prefix) {
4
+ try {
5
+ const fake = createFakeContact(message);
6
+
7
+ // Get quoted message
8
+ const quoted = message.message?.extendedTextMessage?.contextInfo?.quotedMessage;
9
+
10
+ // Check if it's a reply to media or text
11
+ const hasQuotedImage = quoted?.imageMessage;
12
+ const hasQuotedVideo = quoted?.videoMessage;
13
+ const hasQuotedDocument = quoted?.documentMessage;
14
+ const hasQuotedText = quoted?.conversation || quoted?.extendedTextMessage?.text;
15
+
16
+ const apiKey = "AIzaSyDE7R-5gnjgeqYGSMGiZVjA5VkSrQvile8"; // Using your Gemini API key
17
+
18
+ // Send processing message
19
+ const processingMsg = await sock.sendMessage(chatId, {
20
+ text: "*AI Analysis in Progress...*\n\nAnalyzing content, please wait..."
21
+ }, { quoted: fake });
22
+
23
+ let analysisResult = "";
24
+
25
+ if (hasQuotedImage) {
26
+ analysisResult = await analyzeImage(quoted, text, apiKey);
27
+ } else if (hasQuotedVideo) {
28
+ analysisResult = await analyzeVideo(quoted, text, apiKey);
29
+ } else if (hasQuotedDocument) {
30
+ analysisResult = await analyzeDocument(quoted, text, apiKey);
31
+ } else if (hasQuotedText) {
32
+ analysisResult = await analyzeText(quoted, text, apiKey);
33
+ } else if (text && text.trim() !== '') {
34
+ analysisResult = await analyzeQuery(text, apiKey);
35
+ } else {
36
+ // Delete processing message
37
+ try { await sock.sendMessage(chatId, { delete: processingMsg.key }); } catch(e) {}
38
+
39
+ await sock.sendMessage(chatId, {
40
+ text: `🔬 *AI Content Analyzer*\n\nI can analyze various types of content:\n\n` +
41
+ `• *Images* - Reply .analyze to an image\n` +
42
+ `• *Videos* - Reply .analyze to a video\n` +
43
+ `• *Documents* - Reply .analyze to a document\n` +
44
+ `• *Text* - Reply .analyze to text or use .analyze <text>\n\n` +
45
+ `*Examples:*\n` +
46
+ `• Reply .analyze to a photo\n` +
47
+ `• .analyze What is in this picture?\n` +
48
+ `• .analyze sentiment This is amazing!\n\n` +
49
+ `*Analysis Types:*\n` +
50
+ `- sentiment (analyze emotions)\n` +
51
+ `- summary (summarize content)\n` +
52
+ `- keywords (extract key topics)\n` +
53
+ `- grammar (check grammar/spelling)\n` +
54
+ `- complexity (analyze readability)`
55
+ }, { quoted: fake });
56
+ return;
57
+ }
58
+
59
+ // Delete processing message
60
+ try { await sock.sendMessage(chatId, { delete: processingMsg.key }); } catch(e) {}
61
+
62
+ // Format and send result
63
+ const formattedResult = `🔬 *AI ANALYSIS REPORT*\n━━━━━━━━━━━━━━━━━━━━━━━\n\n${analysisResult}\n\n━━━━━━━━━━━━━━━━━━━━━━━\n🧠 *Analyzed by DAVE-X AI*\n⚡ Powered by Gemini AI`;
64
+
65
+ await sock.sendMessage(chatId, { text: formattedResult }, { quoted: fake });
66
+
67
+ } catch (error) {
68
+ console.error('Analyze command error:', error);
69
+ const fake = createFakeContact(message);
70
+ await sock.sendMessage(chatId, {
71
+ text: `❌ *Analysis Failed*\n\nError: ${error.message}\n\nPlease try again with different content.`
72
+ }, { quoted: fake });
73
+ }
74
+ }
75
+
76
+ // Helper functions
77
+ async function analyzeImage(quotedMsg, query, apiKey) {
78
+ try {
79
+ const imageCaption = quotedMsg.imageMessage?.caption || "an image";
80
+ const prompt = query || "Describe this image in detail. What do you see? Be specific about objects, colors, scene, mood, and any text present.";
81
+
82
+ const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${apiKey}`, {
83
+ method: "POST",
84
+ headers: {
85
+ "Content-Type": "application/json"
86
+ },
87
+ body: JSON.stringify({
88
+ contents: [{
89
+ parts: [{
90
+ text: `${prompt}\n\nNote: I cannot see the actual image, but here's the description: "${imageCaption}"`
91
+ }]
92
+ }]
93
+ })
94
+ });
95
+
96
+ const data = await response.json();
97
+ return data.candidates?.[0]?.content?.parts?.[0]?.text || "Could not analyze image.";
98
+
99
+ } catch (error) {
100
+ throw new Error(`Image analysis failed: ${error.message}`);
101
+ }
102
+ }
103
+
104
+ async function analyzeVideo(quotedMsg, query, apiKey) {
105
+ const videoCaption = quotedMsg.videoMessage?.caption || "a video";
106
+ const videoSeconds = quotedMsg.videoMessage?.seconds || 'unknown';
107
+ const prompt = query || "Analyze this video. What might it contain? Consider duration, possible content, and context.";
108
+
109
+ const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${apiKey}`, {
110
+ method: "POST",
111
+ headers: {
112
+ "Content-Type": "application/json"
113
+ },
114
+ body: JSON.stringify({
115
+ contents: [{
116
+ parts: [{
117
+ text: `${prompt}\n\nVideo description: "${videoCaption}"\nDuration: ${videoSeconds} seconds`
118
+ }]
119
+ }]
120
+ })
121
+ });
122
+
123
+ const data = await response.json();
124
+ return data.candidates?.[0]?.content?.parts?.[0]?.text || "Could not analyze video.";
125
+ }
126
+
127
+ async function analyzeDocument(quotedMsg, query, apiKey) {
128
+ const docName = quotedMsg.documentMessage?.fileName || "a document";
129
+ const fileSize = quotedMsg.documentMessage?.fileLength ?
130
+ Math.round(quotedMsg.documentMessage.fileLength / 1024) + "KB" : "unknown size";
131
+ const mimeType = quotedMsg.documentMessage?.mimetype || "unknown type";
132
+
133
+ const prompt = query || `Analyze this document.\n\nDocument info:\n- Name: ${docName}\n- Type: ${mimeType}\n- Size: ${fileSize}\n\nWhat kind of document might this be? What could it contain?`;
134
+
135
+ const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${apiKey}`, {
136
+ method: "POST",
137
+ headers: {
138
+ "Content-Type": "application/json"
139
+ },
140
+ body: JSON.stringify({
141
+ contents: [{
142
+ parts: [{
143
+ text: prompt
144
+ }]
145
+ }]
146
+ })
147
+ });
148
+
149
+ const data = await response.json();
150
+ return data.candidates?.[0]?.content?.parts?.[0]?.text || "Could not analyze document.";
151
+ }
152
+
153
+ async function analyzeText(quotedMsg, query, apiKey) {
154
+ let textContent = "";
155
+
156
+ if (quotedMsg.conversation) {
157
+ textContent = quotedMsg.conversation;
158
+ } else if (quotedMsg.extendedTextMessage?.text) {
159
+ textContent = quotedMsg.extendedTextMessage.text;
160
+ }
161
+
162
+ if (!textContent) {
163
+ return "No text content found to analyze.";
164
+ }
165
+
166
+ const analysisType = query?.toLowerCase().split(' ')[0] || "general";
167
+ let prompt = "";
168
+
169
+ switch (analysisType) {
170
+ case "sentiment":
171
+ prompt = `Analyze the sentiment of this text:\n\n"${textContent}"\n\nIs it positive, negative, or neutral? What emotions are expressed?`;
172
+ break;
173
+ case "summary":
174
+ prompt = `Summarize this text concisely:\n\n"${textContent}"`;
175
+ break;
176
+ case "keywords":
177
+ prompt = `Extract key topics and keywords from this text:\n\n"${textContent}"`;
178
+ break;
179
+ case "grammar":
180
+ prompt = `Check grammar and spelling in this text:\n\n"${textContent}"\n\nProvide corrections and suggestions.`;
181
+ break;
182
+ case "complexity":
183
+ prompt = `Analyze the reading complexity of this text:\n\n"${textContent}"\n\nWhat reading level is it? Is it easy or difficult to understand?`;
184
+ break;
185
+ case "tone":
186
+ prompt = `Analyze the tone and style of this text:\n\n"${textContent}"\n\nIs it formal, informal, academic, casual, etc.?`;
187
+ break;
188
+ default:
189
+ prompt = `Analyze this text comprehensively:\n\n"${textContent}"\n\nProvide insights about:\n1. Main topic/theme\n2. Key points\n3. Writing style\n4. Potential purpose/audience\n5. Any notable patterns or insights`;
190
+ }
191
+
192
+ const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${apiKey}`, {
193
+ method: "POST",
194
+ headers: {
195
+ "Content-Type": "application/json"
196
+ },
197
+ body: JSON.stringify({
198
+ contents: [{
199
+ parts: [{
200
+ text: prompt
201
+ }]
202
+ }]
203
+ })
204
+ });
205
+
206
+ const data = await response.json();
207
+ return data.candidates?.[0]?.content?.parts?.[0]?.text || "Could not analyze text.";
208
+ }
209
+
210
+ async function analyzeQuery(query, apiKey) {
211
+ const prompt = `Analyze this query or content: "${query}"\n\nProvide a comprehensive analysis including:\n1. Main topic/request\n2. Key elements to consider\n3. Potential approaches or solutions\n4. Related concepts\n5. Recommendations or next steps`;
212
+
213
+ const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${apiKey}`, {
214
+ method: "POST",
215
+ headers: {
216
+ "Content-Type": "application/json"
217
+ },
218
+ body: JSON.stringify({
219
+ contents: [{
220
+ parts: [{
221
+ text: prompt
222
+ }]
223
+ }]
224
+ })
225
+ });
226
+
227
+ const data = await response.json();
228
+ return data.candidates?.[0]?.content?.parts?.[0]?.text || "Could not analyze query.";
229
+ }
230
+
231
+ module.exports = {
232
+ analyzeCommand
233
+ };
@@ -0,0 +1,101 @@
1
+ const axios = require('axios');
2
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
3
+
4
+ async function bardCommand(sock, chatId, message) {
5
+ const fake = createFakeContact(message);
6
+ const botName = getBotName();
7
+
8
+ try {
9
+ // Send initial reaction
10
+ await sock.sendMessage(chatId, {
11
+ react: { text: '⏳', key: message.key }
12
+ });
13
+
14
+ const text = message.message?.conversation ||
15
+ message.message?.extendedTextMessage?.text ||
16
+ message.message?.imageMessage?.caption ||
17
+ '';
18
+
19
+ if (!text.includes(' ')) {
20
+ return await sock.sendMessage(chatId, {
21
+ text: `✦ *${botName}* Bard AI\n\nUse: .bard <question>\nExample: .bard what is AI`
22
+ }, { quoted: fake });
23
+ }
24
+
25
+ const parts = text.split(' ');
26
+ const query = parts.slice(1).join(' ').trim();
27
+
28
+ if (!query) {
29
+ return await sock.sendMessage(chatId, {
30
+ text: `✦ *${botName}*\nProvide a question`
31
+ }, { quoted: fake });
32
+ }
33
+
34
+ if (query.length > 1000) {
35
+ return await sock.sendMessage(chatId, {
36
+ text: `✦ *${botName}*\nQuestion too long (max 1000 chars)`
37
+ }, { quoted: fake });
38
+ }
39
+
40
+ // Update presence to "typing"
41
+ await sock.sendPresenceUpdate('composing', chatId);
42
+
43
+ // Fetch AI response using Bard API
44
+ const apiUrl = `https://apiskeith.top/ai/bard?q=${encodeURIComponent(query)}`;
45
+ const response = await axios.get(apiUrl, { timeout: 30000 });
46
+ const apiData = response.data;
47
+
48
+ if (!apiData?.status || !apiData?.result) {
49
+ throw new Error("API failed to generate response!");
50
+ }
51
+
52
+ // Send success reaction
53
+ await sock.sendMessage(chatId, {
54
+ react: { text: '✅', key: message.key }
55
+ });
56
+
57
+ // Format and send response
58
+ const aiResponse = apiData.result.trim();
59
+
60
+ await sock.sendMessage(chatId, {
61
+ text: `✦ *${botName}* - am know invisible 🔥
62
+
63
+ ✦ Question: ${query}
64
+
65
+ ✦ ${aiResponse}`
66
+ }, { quoted: fake });
67
+
68
+ // Send final reaction
69
+ await sock.sendMessage(chatId, {
70
+ react: { text: '📤', key: message.key }
71
+ });
72
+
73
+ } catch (error) {
74
+ console.error("Bard AI command error:", error);
75
+
76
+ // Send error reaction
77
+ await sock.sendMessage(chatId, {
78
+ react: { text: '❌', key: message.key }
79
+ });
80
+
81
+ let errorMessage = "✦ Failed to generate response";
82
+
83
+ if (error.response?.status === 404) {
84
+ errorMessage = '✦ Service unavailable';
85
+ } else if (error.message.includes('timeout') || error.code === 'ECONNABORTED') {
86
+ errorMessage = '✦ Request timeout';
87
+ } else if (error.code === 'ENOTFOUND') {
88
+ errorMessage = '✦ Network error';
89
+ } else if (error.response?.status === 429) {
90
+ errorMessage = '✦ Too many requests';
91
+ } else if (error.response?.status >= 500) {
92
+ errorMessage = '✦ Server error';
93
+ }
94
+
95
+ await sock.sendMessage(chatId, {
96
+ text: errorMessage
97
+ }, { quoted: fake });
98
+ }
99
+ }
100
+
101
+ module.exports = bardCommand;
@@ -0,0 +1,101 @@
1
+ const axios = require('axios');
2
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
3
+
4
+ async function birdCommand(sock, chatId, message) {
5
+ const fake = createFakeContact(message);
6
+ const botName = getBotName();
7
+
8
+ try {
9
+ // Send initial reaction
10
+ await sock.sendMessage(chatId, {
11
+ react: { text: '⏳', key: message.key }
12
+ });
13
+
14
+ const text = message.message?.conversation ||
15
+ message.message?.extendedTextMessage?.text ||
16
+ message.message?.imageMessage?.caption ||
17
+ '';
18
+
19
+ if (!text.includes(' ')) {
20
+ return await sock.sendMessage(chatId, {
21
+ text: `✦ *${botName}* Bard AI\n\nUse: .bard <question>\nExample: .bard what is AI`
22
+ }, { quoted: fake });
23
+ }
24
+
25
+ const parts = text.split(' ');
26
+ const query = parts.slice(1).join(' ').trim();
27
+
28
+ if (!query) {
29
+ return await sock.sendMessage(chatId, {
30
+ text: `✦ *${botName}*\nProvide a question`
31
+ }, { quoted: fake });
32
+ }
33
+
34
+ if (query.length > 1000) {
35
+ return await sock.sendMessage(chatId, {
36
+ text: `✦ *${botName}*\nQuestion too long (max 1000 chars)`
37
+ }, { quoted: fake });
38
+ }
39
+
40
+ // Update presence to "typing"
41
+ await sock.sendPresenceUpdate('composing', chatId);
42
+
43
+ // Fetch AI response using Bard API
44
+ const apiUrl = `https://apiskeith.top/ai/bard?q=${encodeURIComponent(query)}`;
45
+ const response = await axios.get(apiUrl, { timeout: 30000 });
46
+ const apiData = response.data;
47
+
48
+ if (!apiData?.status || !apiData?.result) {
49
+ throw new Error("API failed to generate response!");
50
+ }
51
+
52
+ // Send success reaction
53
+ await sock.sendMessage(chatId, {
54
+ react: { text: '✅', key: message.key }
55
+ });
56
+
57
+ // Format and send response
58
+ const aiResponse = apiData.result.trim();
59
+
60
+ await sock.sendMessage(chatId, {
61
+ text: `✦ *${botName}* - am know invisible 🔥
62
+
63
+ ✦ Question: ${query}
64
+
65
+ ✦ ${aiResponse}`
66
+ }, { quoted: fake });
67
+
68
+ // Send final reaction
69
+ await sock.sendMessage(chatId, {
70
+ react: { text: '📤', key: message.key }
71
+ });
72
+
73
+ } catch (error) {
74
+ console.error("Bard AI command error:", error);
75
+
76
+ // Send error reaction
77
+ await sock.sendMessage(chatId, {
78
+ react: { text: '❌', key: message.key }
79
+ });
80
+
81
+ let errorMessage = "✦ Failed to generate response";
82
+
83
+ if (error.response?.status === 404) {
84
+ errorMessage = '✦ Service unavailable';
85
+ } else if (error.message.includes('timeout') || error.code === 'ECONNABORTED') {
86
+ errorMessage = '✦ Request timeout';
87
+ } else if (error.code === 'ENOTFOUND') {
88
+ errorMessage = '✦ Network error';
89
+ } else if (error.response?.status === 429) {
90
+ errorMessage = '✦ Too many requests';
91
+ } else if (error.response?.status >= 500) {
92
+ errorMessage = '✦ Server error';
93
+ }
94
+
95
+ await sock.sendMessage(chatId, {
96
+ text: errorMessage
97
+ }, { quoted: fake });
98
+ }
99
+ }
100
+
101
+ module.exports = birdCommand;
@@ -0,0 +1,30 @@
1
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
2
+ const axios = require('axios');
3
+
4
+ async function blackboxCommand(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} BLACKBOX AI*\n\nUsage: .blackbox <question>\nExample: .blackbox write a python hello world` }, { 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/ai/blackbox?q=${encodeURIComponent(query)}`, { timeout: 20000 });
17
+ const result = res.data?.BK9 || res.data?.result || res.data?.response;
18
+
19
+ if (result) {
20
+ await sock.sendMessage(chatId, { text: result.substring(0, 3000) }, { quoted: fakeContact });
21
+ await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
22
+ } else {
23
+ await sock.sendMessage(chatId, { text: `*${botName}*\nNo response received. Try again.` }, { quoted: fakeContact });
24
+ }
25
+ } catch (err) {
26
+ await sock.sendMessage(chatId, { text: `*${botName}*\nError: ${err.message}` }, { quoted: fakeContact });
27
+ }
28
+ }
29
+
30
+ module.exports = blackboxCommand;
@@ -0,0 +1,80 @@
1
+ const axios = require('axios');
2
+ const { channelInfo } = require('../../davelib/messageConfig');
3
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
4
+ async function characterCommand(sock, chatId, message) {
5
+ const fake = createFakeContact(message);
6
+ let userToAnalyze;
7
+
8
+ // Check for mentioned users
9
+ if (message.message?.extendedTextMessage?.contextInfo?.mentionedJid?.length > 0) {
10
+ userToAnalyze = message.message.extendedTextMessage.contextInfo.mentionedJid[0];
11
+ }
12
+ // Check for replied message
13
+ else if (message.message?.extendedTextMessage?.contextInfo?.participant) {
14
+ userToAnalyze = message.message.extendedTextMessage.contextInfo.participant;
15
+ }
16
+
17
+ if (!userToAnalyze) {
18
+ await sock.sendMessage(chatId, {
19
+ text: 'Please mention someone or reply to their message to analyze their character!'
20
+ }, { quoted: fake });
21
+ return;
22
+ }
23
+
24
+ try {
25
+ // Get user's profile picture
26
+ let profilePic;
27
+ try {
28
+ profilePic = await sock.profilePictureUrl(userToAnalyze, 'image');
29
+ } catch {
30
+ profilePic = 'https://i.imgur.com/2wzGhpF.jpeg'; // Default image if no profile pic
31
+ }
32
+
33
+ const traits = [
34
+ "Intelligent", "Creative", "Determined", "Ambitious", "Caring",
35
+ "Charismatic", "Confident", "Empathetic", "Energetic", "Friendly",
36
+ "Generous", "Honest", "Humorous", "Imaginative", "Independent",
37
+ "Intuitive", "Kind", "Logical", "Loyal", "Optimistic",
38
+ "Passionate", "Patient", "Persistent", "Reliable", "Resourceful",
39
+ "Sincere", "Thoughtful", "Understanding", "Versatile", "Wise"
40
+ ];
41
+
42
+ // Get 3-5 random traits
43
+ const numTraits = Math.floor(Math.random() * 3) + 3; // Random number between 3 and 5
44
+ const selectedTraits = [];
45
+ for (let i = 0; i < numTraits; i++) {
46
+ const randomTrait = traits[Math.floor(Math.random() * traits.length)];
47
+ if (!selectedTraits.includes(randomTrait)) {
48
+ selectedTraits.push(randomTrait);
49
+ }
50
+ }
51
+
52
+ // Calculate random percentages for each trait
53
+ const traitPercentages = selectedTraits.map(trait => {
54
+ const percentage = Math.floor(Math.random() * 41) + 60; // Random number between 60-100
55
+ return `${trait}: ${percentage}%`;
56
+ });
57
+
58
+ // Create character analysis message
59
+ const analysis = `Character Analysis\n\n` +
60
+ `User: ${userToAnalyze.split('@')[0]}\n\n` +
61
+ `Key Traits:\n${traitPercentages.join('\n')}\n\n` +
62
+ `Overall Rating: ${Math.floor(Math.random() * 21) + 80}%\n\n` +
63
+ `Note: This is a fun analysis and should not be taken seriously!`;
64
+
65
+ // Send the analysis with the user's profile picture
66
+ await sock.sendMessage(chatId, {
67
+ image: { url: profilePic },
68
+ caption: analysis,
69
+ mentions: [userToAnalyze]
70
+ }, { quoted: fake });
71
+
72
+ } catch (error) {
73
+ console.error('Error in character command:', error);
74
+ await sock.sendMessage(chatId, {
75
+ text: 'Failed to analyze character! Try again later.'
76
+ }, { quoted: fake });
77
+ }
78
+ }
79
+
80
+ module.exports = characterCommand;
@@ -0,0 +1,58 @@
1
+ const axios = require('axios');
2
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
3
+ async function copilotCommand(sock, chatId, message) {
4
+ const fake = createFakeContact(message);
5
+
6
+ const text = message.message?.conversation ||
7
+ message.message?.extendedTextMessage?.text || '';
8
+
9
+ const query = text.split(' ').slice(1).join(' ').trim();
10
+
11
+ if (!query) {
12
+ return sock.sendMessage(chatId, {
13
+ text: "Microsoft Copilot\nUse: .copilot [your question]\nExample: .copilot help me code a login system"
14
+ }, { quoted: fake });
15
+ }
16
+
17
+ try {
18
+ const apiUrl = `https://iamtkm.vercel.app/ai/copilot?apikey=tkm&text=${encodeURIComponent(query)}`;
19
+
20
+ const response = await axios.get(apiUrl, {
21
+ timeout: 30000,
22
+ headers: {
23
+ 'User-Agent': 'WhatsApp-Bot/1.0'
24
+ }
25
+ });
26
+
27
+ const data = response.data;
28
+
29
+ if (data.status && data.statusCode === 200 && data.result) {
30
+ await sock.sendMessage(chatId, {
31
+ text: data.result
32
+ }, { quoted: fake });
33
+ } else {
34
+ await sock.sendMessage(chatId, {
35
+ text: "No response from Copilot"
36
+ }, { quoted: fake });
37
+ }
38
+
39
+ } catch (error) {
40
+ console.error('Copilot Error:', error);
41
+
42
+ if (error.response?.status === 429) {
43
+ await sock.sendMessage(chatId, {
44
+ text: "Too many requests. Wait 5 minutes."
45
+ }, { quoted: fake });
46
+ } else if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') {
47
+ await sock.sendMessage(chatId, {
48
+ text: "Request timeout"
49
+ }, { quoted: fake });
50
+ } else {
51
+ await sock.sendMessage(chatId, {
52
+ text: "Copilot service error"
53
+ }, { quoted: fake });
54
+ }
55
+ }
56
+ }
57
+
58
+ module.exports = copilotCommand;
@@ -0,0 +1,39 @@
1
+ const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
2
+ const axios = require('axios');
3
+
4
+ async function dalleCommand(sock, chatId, message, args) {
5
+ const fakeContact = createFakeContact(message);
6
+ const botName = getBotName();
7
+ const prompt = args.join(' ').trim();
8
+
9
+ if (!prompt) {
10
+ return sock.sendMessage(chatId, { text: `*${botName} DALL-E*\n\nUsage: .dalle <prompt>\nExample: .dalle a cat wearing sunglasses` }, { quoted: fakeContact });
11
+ }
12
+
13
+ await sock.sendMessage(chatId, { react: { text: '🎨', key: message.key } });
14
+ await sock.sendMessage(chatId, { text: `*${botName}*\nGenerating image: "${prompt}"...` }, { quoted: fakeContact });
15
+
16
+ try {
17
+ const apis = [
18
+ `https://bk9.fun/ai/magicstudio?prompt=${encodeURIComponent(prompt)}`,
19
+ `https://api.siputzx.my.id/api/ai/text2img?prompt=${encodeURIComponent(prompt)}`,
20
+ ];
21
+
22
+ for (const url of apis) {
23
+ try {
24
+ const res = await axios.get(url, { timeout: 30000 });
25
+ const imgUrl = res.data?.BK9 || res.data?.result || res.data?.data?.url || res.data?.url;
26
+ if (imgUrl) {
27
+ await sock.sendMessage(chatId, { image: { url: imgUrl }, caption: `*${botName} DALL-E*\nPrompt: ${prompt}` }, { quoted: fakeContact });
28
+ await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
29
+ return;
30
+ }
31
+ } catch {}
32
+ }
33
+ await sock.sendMessage(chatId, { text: `*${botName}*\nFailed to generate image. Try again.` }, { quoted: fakeContact });
34
+ } catch (err) {
35
+ await sock.sendMessage(chatId, { text: `*${botName}*\nError: ${err.message}` }, { quoted: fakeContact });
36
+ }
37
+ }
38
+
39
+ module.exports = dalleCommand;