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,577 @@
1
+ const { getGroupConfig, setGroupConfig, deleteGroupToggle, getOwnerConfig, setOwnerConfig } = require('../Database/settingsStore');
2
+ const db = require('../Database/database');
3
+ const { migrateFromJson, cleanupLegacyFiles } = require('../Database/migration');
4
+ const { createFakeContact, getBotName, getMenuImage, getOwnerName, createStyledMessage, createSuccessMessage, createErrorMessage, createInfoMessage, sendWithFakeContact, sendStyledWithFakeContact } = require('./fakeContact');
5
+
6
+ migrateFromJson();
7
+
8
+ function loadUserGroupData() {
9
+ try {
10
+ const result = {
11
+ antibadword: {},
12
+ antilink: {},
13
+ antitag: {},
14
+ antimention: {},
15
+ antigroupmention: {},
16
+ antidemote: {},
17
+ antisticker: {},
18
+ antiimage: {},
19
+ antiaudio: {},
20
+ antidocument: {},
21
+ antifiles: {},
22
+ antipromote: {},
23
+ antivideo: {},
24
+ antibug: {},
25
+ antichart: {},
26
+ welcome: {},
27
+ goodbye: {},
28
+ chatbot: {},
29
+ warnings: {},
30
+ sudo: db.getAllSudoUsers()
31
+ };
32
+
33
+ const allGroupJids = db.getAllGroupJids();
34
+ for (const groupJid of allGroupJids) {
35
+ const settings = db.getAllGroupSettings(groupJid);
36
+ for (const [key, value] of Object.entries(settings)) {
37
+ if (result.hasOwnProperty(key)) {
38
+ result[key][groupJid] = value;
39
+ }
40
+ }
41
+ }
42
+
43
+ result.warnings = db.getAllWarnings();
44
+
45
+ return result;
46
+ } catch (error) {
47
+ console.error('Error loading user group data:', error);
48
+ return {
49
+ antibadword: {},
50
+ antilink: {},
51
+ antitag: {},
52
+ antimention: {},
53
+ antigroupmention: {},
54
+ antidemote: {},
55
+ antisticker: {},
56
+ antiimage: {},
57
+ antiaudio: {},
58
+ antidocument: {},
59
+ antifiles: {},
60
+ antipromote: {},
61
+ antivideo: {},
62
+ antibug: {},
63
+ antichart: {},
64
+ welcome: {},
65
+ goodbye: {},
66
+ chatbot: {},
67
+ warnings: {},
68
+ sudo: []
69
+ };
70
+ }
71
+ }
72
+
73
+ function saveUserGroupData(data) {
74
+ try {
75
+ if (data.sudo && Array.isArray(data.sudo)) {
76
+ const currentSudo = db.getAllSudoUsers();
77
+ for (const user of data.sudo) {
78
+ if (!currentSudo.includes(user)) {
79
+ db.addSudoUser(user);
80
+ }
81
+ }
82
+ }
83
+
84
+ const features = [
85
+ 'antibadword', 'antilink', 'antitag', 'antimention', 'antigroupmention',
86
+ 'antidemote', 'antisticker', 'antiimage', 'antiaudio', 'antidocument',
87
+ 'antifiles', 'antipromote', 'antivideo', 'antibug', 'antichart',
88
+ 'welcome', 'goodbye', 'chatbot'
89
+ ];
90
+
91
+ for (const feature of features) {
92
+ if (data[feature] && typeof data[feature] === 'object') {
93
+ for (const [groupId, config] of Object.entries(data[feature])) {
94
+ setGroupConfig(groupId, feature, config);
95
+ }
96
+ }
97
+ }
98
+
99
+ if (data.warnings && typeof data.warnings === 'object') {
100
+ for (const [groupId, users] of Object.entries(data.warnings)) {
101
+ if (typeof users === 'object') {
102
+ for (const [userId, count] of Object.entries(users)) {
103
+ db.setWarningCount(groupId, userId, count);
104
+ }
105
+ }
106
+ }
107
+ }
108
+
109
+ return true;
110
+ } catch (error) {
111
+ console.error('Error saving user group data:', error);
112
+ return false;
113
+ }
114
+ }
115
+
116
+ async function setAntilink(groupId, type, action) {
117
+ setGroupConfig(groupId, 'antilink', {
118
+ enabled: type === 'on' || type === 'delete' || type === 'kick' || type === 'warn',
119
+ action: action || 'delete'
120
+ });
121
+ return true;
122
+ }
123
+
124
+ async function getAntilink(groupId) {
125
+ return getGroupConfig(groupId, 'antilink');
126
+ }
127
+
128
+ async function removeAntilink(groupId) {
129
+ deleteGroupToggle(groupId, 'antilink');
130
+ return true;
131
+ }
132
+
133
+ async function setAntimention(groupId, type, action, maxMentions = 5) {
134
+ setGroupConfig(groupId, 'antimention', {
135
+ enabled: type === 'on' || type === true,
136
+ action: action || 'delete',
137
+ maxMentions: maxMentions
138
+ });
139
+ return true;
140
+ }
141
+
142
+ async function getAntimention(groupId) {
143
+ return getGroupConfig(groupId, 'antimention');
144
+ }
145
+
146
+ async function removeAntimention(groupId) {
147
+ deleteGroupToggle(groupId, 'antimention');
148
+ return true;
149
+ }
150
+
151
+ async function setAntitag(groupId, type, action) {
152
+ setGroupConfig(groupId, 'antitag', {
153
+ enabled: type === 'on',
154
+ action: action || 'delete'
155
+ });
156
+ return true;
157
+ }
158
+
159
+ async function getAntitag(groupId) {
160
+ return getGroupConfig(groupId, 'antitag');
161
+ }
162
+
163
+ async function removeAntitag(groupId) {
164
+ deleteGroupToggle(groupId, 'antitag');
165
+ return true;
166
+ }
167
+
168
+ async function setAntigroupmention(groupId, type, action) {
169
+ setGroupConfig(groupId, 'antigroupmention', {
170
+ enabled: type === 'on',
171
+ action: action || 'delete'
172
+ });
173
+ return true;
174
+ }
175
+
176
+ async function getAntigroupmention(groupId) {
177
+ return getGroupConfig(groupId, 'antigroupmention');
178
+ }
179
+
180
+ async function removeAntigroupmention(groupId) {
181
+ deleteGroupToggle(groupId, 'antigroupmention');
182
+ return true;
183
+ }
184
+
185
+ async function setAntidemote(groupId, type) {
186
+ setGroupConfig(groupId, 'antidemote', {
187
+ enabled: type === 'on' || type === true
188
+ });
189
+ return true;
190
+ }
191
+
192
+ async function getAntidemote(groupId) {
193
+ return getGroupConfig(groupId, 'antidemote');
194
+ }
195
+
196
+ async function removeAntidemote(groupId) {
197
+ deleteGroupToggle(groupId, 'antidemote');
198
+ return true;
199
+ }
200
+
201
+ async function setAntipromote(groupId, type) {
202
+ setGroupConfig(groupId, 'antipromote', {
203
+ enabled: type === 'on' || type === true
204
+ });
205
+ return true;
206
+ }
207
+
208
+ async function getAntipromote(groupId) {
209
+ return getGroupConfig(groupId, 'antipromote');
210
+ }
211
+
212
+ async function removeAntipromote(groupId) {
213
+ deleteGroupToggle(groupId, 'antipromote');
214
+ return true;
215
+ }
216
+
217
+ async function setAntisticker(groupId, type, action) {
218
+ setGroupConfig(groupId, 'antisticker', {
219
+ enabled: type === 'on' || type === true,
220
+ action: action || 'delete'
221
+ });
222
+ return true;
223
+ }
224
+
225
+ async function getAntisticker(groupId) {
226
+ return getGroupConfig(groupId, 'antisticker');
227
+ }
228
+
229
+ async function removeAntisticker(groupId) {
230
+ deleteGroupToggle(groupId, 'antisticker');
231
+ return true;
232
+ }
233
+
234
+ async function setAntiimage(groupId, type, action) {
235
+ setGroupConfig(groupId, 'antiimage', {
236
+ enabled: type === 'on' || type === true,
237
+ action: action || 'delete'
238
+ });
239
+ return true;
240
+ }
241
+
242
+ async function getAntiimage(groupId) {
243
+ return getGroupConfig(groupId, 'antiimage');
244
+ }
245
+
246
+ async function removeAntiimage(groupId) {
247
+ deleteGroupToggle(groupId, 'antiimage');
248
+ return true;
249
+ }
250
+
251
+ async function setAntiaudio(groupId, type, action) {
252
+ setGroupConfig(groupId, 'antiaudio', {
253
+ enabled: type === 'on' || type === true,
254
+ action: action || 'delete'
255
+ });
256
+ return true;
257
+ }
258
+
259
+ async function getAntiaudio(groupId) {
260
+ return getGroupConfig(groupId, 'antiaudio');
261
+ }
262
+
263
+ async function removeAntiaudio(groupId) {
264
+ deleteGroupToggle(groupId, 'antiaudio');
265
+ return true;
266
+ }
267
+
268
+ async function setAntidocument(groupId, type, action) {
269
+ setGroupConfig(groupId, 'antidocument', {
270
+ enabled: type === 'on' || type === true,
271
+ action: action || 'delete'
272
+ });
273
+ return true;
274
+ }
275
+
276
+ async function getAntidocument(groupId) {
277
+ return getGroupConfig(groupId, 'antidocument');
278
+ }
279
+
280
+ async function removeAntidocument(groupId) {
281
+ deleteGroupToggle(groupId, 'antidocument');
282
+ return true;
283
+ }
284
+
285
+ async function setAntifiles(groupId, type, action) {
286
+ setGroupConfig(groupId, 'antifiles', {
287
+ enabled: type === 'on' || type === true,
288
+ action: action || 'delete'
289
+ });
290
+ return true;
291
+ }
292
+
293
+ async function getAntifiles(groupId) {
294
+ return getGroupConfig(groupId, 'antifiles');
295
+ }
296
+
297
+ async function removeAntifiles(groupId) {
298
+ deleteGroupToggle(groupId, 'antifiles');
299
+ return true;
300
+ }
301
+
302
+ async function setAntivideo(groupId, type, action) {
303
+ setGroupConfig(groupId, 'antivideo', {
304
+ enabled: type === 'on' || type === true,
305
+ action: action || 'delete'
306
+ });
307
+ return true;
308
+ }
309
+
310
+ async function getAntivideo(groupId) {
311
+ return getGroupConfig(groupId, 'antivideo');
312
+ }
313
+
314
+ async function removeAntivideo(groupId) {
315
+ deleteGroupToggle(groupId, 'antivideo');
316
+ return true;
317
+ }
318
+
319
+ async function setAntibug(groupId, type) {
320
+ setGroupConfig(groupId, 'antibug', {
321
+ enabled: type === 'on' || type === true
322
+ });
323
+ return true;
324
+ }
325
+
326
+ async function getAntibug(groupId) {
327
+ return getGroupConfig(groupId, 'antibug');
328
+ }
329
+
330
+ async function removeAntibug(groupId) {
331
+ deleteGroupToggle(groupId, 'antibug');
332
+ return true;
333
+ }
334
+
335
+ async function setAntichart(groupId, enabled, action, blockedUsers = []) {
336
+ setGroupConfig(groupId, 'antichart', {
337
+ enabled: enabled === true || enabled === 'on',
338
+ action: action || 'delete',
339
+ blockedUsers: blockedUsers || []
340
+ });
341
+ return true;
342
+ }
343
+
344
+ async function getAntichart(groupId) {
345
+ return getGroupConfig(groupId, 'antichart');
346
+ }
347
+
348
+ async function removeAntichart(groupId) {
349
+ deleteGroupToggle(groupId, 'antichart');
350
+ return true;
351
+ }
352
+
353
+ async function setAntiBadword(groupId, type, action) {
354
+ setGroupConfig(groupId, 'antibadword', {
355
+ enabled: type === 'on',
356
+ action: action || 'delete'
357
+ });
358
+ return true;
359
+ }
360
+
361
+ async function getAntiBadword(groupId) {
362
+ return getGroupConfig(groupId, 'antibadword');
363
+ }
364
+
365
+ async function removeAntiBadword(groupId) {
366
+ setGroupConfig(groupId, 'antibadword', { enabled: false, action: 'delete' });
367
+ return true;
368
+ }
369
+
370
+ function incrementWarningCount(groupId, userId) {
371
+ return db.incrementWarning(groupId, userId);
372
+ }
373
+
374
+ function resetWarningCount(groupId, userId) {
375
+ db.resetWarning(groupId, userId);
376
+ return true;
377
+ }
378
+
379
+ function isSudo(userId) {
380
+ return db.isSudo(userId);
381
+ }
382
+
383
+ function addSudo(userId) {
384
+ db.addSudoUser(userId);
385
+ return true;
386
+ }
387
+
388
+ function removeSudo(userId) {
389
+ db.removeSudoUser(userId);
390
+ return true;
391
+ }
392
+
393
+ function getSudoList() {
394
+ return db.getAllSudoUsers();
395
+ }
396
+
397
+ async function addWelcome(groupId, enabled, message) {
398
+ setGroupConfig(groupId, 'welcome', { enabled: enabled, message: message || '' });
399
+ return true;
400
+ }
401
+
402
+ async function delWelcome(groupId) {
403
+ setGroupConfig(groupId, 'welcome', { enabled: false, message: '' });
404
+ return true;
405
+ }
406
+
407
+ async function isWelcomeOn(groupId) {
408
+ const config = getGroupConfig(groupId, 'welcome');
409
+ return config?.enabled || false;
410
+ }
411
+
412
+ async function getWelcome(groupId) {
413
+ const config = getGroupConfig(groupId, 'welcome');
414
+ return config?.message || null;
415
+ }
416
+
417
+ async function addGoodbye(groupId, enabled, message) {
418
+ setGroupConfig(groupId, 'goodbye', { enabled: enabled, message: message || '' });
419
+ return true;
420
+ }
421
+
422
+ async function delGoodBye(groupId) {
423
+ setGroupConfig(groupId, 'goodbye', { enabled: false, message: '' });
424
+ return true;
425
+ }
426
+
427
+ async function isGoodByeOn(groupId) {
428
+ const config = getGroupConfig(groupId, 'goodbye');
429
+ return config?.enabled || false;
430
+ }
431
+
432
+ async function getGoodbye(groupId) {
433
+ const config = getGroupConfig(groupId, 'goodbye');
434
+ return config?.message || null;
435
+ }
436
+
437
+ async function setChatbot(groupId, type) {
438
+ setGroupConfig(groupId, 'chatbot', type === 'on' || type === true);
439
+ return true;
440
+ }
441
+
442
+ async function getChatbot(groupId) {
443
+ return getGroupConfig(groupId, 'chatbot');
444
+ }
445
+
446
+ async function removeChatbot(groupId) {
447
+ setGroupConfig(groupId, 'chatbot', false);
448
+ return true;
449
+ }
450
+
451
+ const bugPatterns = [
452
+ /\u0000/g,
453
+ /\u200E{100,}/g,
454
+ /\u200F{100,}/g,
455
+ /\u202A{50,}/g,
456
+ /\u202B{50,}/g,
457
+ /\u202C{50,}/g,
458
+ /\u202D{50,}/g,
459
+ /\u202E{50,}/g,
460
+ /\u2060{50,}/g,
461
+ /\u2061{50,}/g,
462
+ /\u2062{50,}/g,
463
+ /\u2063{50,}/g,
464
+ /\u2064{50,}/g,
465
+ /\uFEFF{50,}/g,
466
+ /[\u0300-\u036F]{50,}/g,
467
+ /(.)\1{500,}/g,
468
+ /\n{100,}/g,
469
+ /\t{100,}/g,
470
+ ];
471
+
472
+ function isBugMessage(message) {
473
+ if (!message) return false;
474
+
475
+ const text = message.message?.conversation ||
476
+ message.message?.extendedTextMessage?.text ||
477
+ message.message?.imageMessage?.caption ||
478
+ message.message?.videoMessage?.caption || '';
479
+
480
+ if (text.length > 50000) return true;
481
+
482
+ for (const pattern of bugPatterns) {
483
+ if (pattern.test(text)) return true;
484
+ }
485
+
486
+ const vcardData = message.message?.contactMessage?.vcard ||
487
+ message.message?.contactsArrayMessage?.contacts?.[0]?.vcard || '';
488
+ if (vcardData.length > 10000) return true;
489
+
490
+ const buttonCount = message.message?.buttonsMessage?.buttons?.length ||
491
+ message.message?.templateMessage?.hydratedTemplate?.hydratedButtons?.length || 0;
492
+ if (buttonCount > 10) return true;
493
+
494
+ const listCount = message.message?.listMessage?.sections?.reduce((acc, s) => acc + (s.rows?.length || 0), 0) || 0;
495
+ if (listCount > 50) return true;
496
+
497
+ return false;
498
+ }
499
+
500
+ module.exports = {
501
+ loadUserGroupData,
502
+ saveUserGroupData,
503
+ setAntilink,
504
+ getAntilink,
505
+ removeAntilink,
506
+ setAntitag,
507
+ getAntitag,
508
+ removeAntitag,
509
+ setAntigroupmention,
510
+ getAntigroupmention,
511
+ removeAntigroupmention,
512
+ setAntidemote,
513
+ getAntidemote,
514
+ removeAntidemote,
515
+ setAntisticker,
516
+ getAntisticker,
517
+ removeAntisticker,
518
+ setAntiimage,
519
+ getAntiimage,
520
+ removeAntiimage,
521
+ setAntiaudio,
522
+ getAntiaudio,
523
+ removeAntiaudio,
524
+ setAntidocument,
525
+ getAntidocument,
526
+ removeAntidocument,
527
+ setAntifiles,
528
+ getAntifiles,
529
+ removeAntifiles,
530
+ setAntipromote,
531
+ getAntipromote,
532
+ removeAntipromote,
533
+ setAntivideo,
534
+ getAntivideo,
535
+ removeAntivideo,
536
+ setAntibug,
537
+ getAntibug,
538
+ removeAntibug,
539
+ setAntichart,
540
+ getAntichart,
541
+ removeAntichart,
542
+ setAntiBadword,
543
+ getAntiBadword,
544
+ removeAntiBadword,
545
+ isBugMessage,
546
+ bugPatterns,
547
+ incrementWarningCount,
548
+ resetWarningCount,
549
+ isSudo,
550
+ addSudo,
551
+ removeSudo,
552
+ getSudoList,
553
+ setAntimention,
554
+ getAntimention,
555
+ removeAntimention,
556
+ addWelcome,
557
+ delWelcome,
558
+ isWelcomeOn,
559
+ getWelcome,
560
+ addGoodbye,
561
+ delGoodBye,
562
+ isGoodByeOn,
563
+ getGoodbye,
564
+ setChatbot,
565
+ getChatbot,
566
+ removeChatbot,
567
+ createFakeContact,
568
+ getBotName,
569
+ getMenuImage,
570
+ getOwnerName,
571
+ createStyledMessage,
572
+ createSuccessMessage,
573
+ createErrorMessage,
574
+ createInfoMessage,
575
+ sendWithFakeContact,
576
+ sendStyledWithFakeContact
577
+ };
@@ -0,0 +1,32 @@
1
+ async function isAdmin(sock, chatId, senderId) {
2
+ try {
3
+ const groupMetadata = await sock.groupMetadata(chatId);
4
+
5
+ const botId = sock.user.id.split(':')[0] + '@s.whatsapp.net';
6
+
7
+ const participant = groupMetadata.participants.find(p =>
8
+ p.id === senderId ||
9
+ p.id === senderId.replace('@s.whatsapp.net', '@lid') ||
10
+ p.id === senderId.replace('@lid', '@s.whatsapp.net')
11
+ );
12
+
13
+ const bot = groupMetadata.participants.find(p =>
14
+ p.id === botId ||
15
+ p.id === botId.replace('@s.whatsapp.net', '@lid')
16
+ );
17
+
18
+ const isBotAdmin = bot && (bot.admin === 'admin' || bot.admin === 'superadmin');
19
+ const isSenderAdmin = participant && (participant.admin === 'admin' || participant.admin === 'superadmin');
20
+
21
+ if (!bot) {
22
+ return { isSenderAdmin, isBotAdmin: true };
23
+ }
24
+
25
+ return { isSenderAdmin, isBotAdmin };
26
+ } catch (error) {
27
+ console.error('Error in isAdmin:', error);
28
+ return { isSenderAdmin: false, isBotAdmin: false };
29
+ }
30
+ }
31
+
32
+ module.exports = isAdmin;
@@ -0,0 +1,12 @@
1
+ const db = require('../Database/database');
2
+
3
+ function isBanned(userId) {
4
+ try {
5
+ return db.isBanned(userId);
6
+ } catch (error) {
7
+ console.error('Error checking banned status:', error);
8
+ return false;
9
+ }
10
+ }
11
+
12
+ module.exports = { isBanned };
@@ -0,0 +1,15 @@
1
+ const settings = require('../daveset');
2
+ const { isSudo } = require('./index');
3
+
4
+ async function isOwnerOrSudo(senderId) {
5
+ // Get owner number from settings
6
+ const ownerJid = settings.ownerNumber + "@s.whatsapp.net";
7
+ if (senderId === ownerJid) return true;
8
+ try {
9
+ return await isSudo(senderId);
10
+ } catch (e) {
11
+ return false;
12
+ }
13
+ }
14
+
15
+ module.exports = isOwnerOrSudo;