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,170 @@
1
+
2
+
3
+
4
+
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod }
7
+ }
8
+ Object.defineProperty(exports, "__esModule", { value: true })
9
+
10
+ const axios = require("axios")
11
+ const cheerio = require("cheerio")
12
+ const { resolve } = require("path")
13
+ const util = require("util")
14
+ let BodyForm = require('form-data')
15
+ let { fromBuffer } = require('file-type')
16
+ //let fetch = require('node-fetch')
17
+ let fs = require('fs')
18
+ const child_process = require('child_process')
19
+ const ffmpeg = require('fluent-ffmpeg')
20
+
21
+ const {unlink } = require ('fs').promises
22
+
23
+
24
+ exports.sleep = async (ms) => {
25
+ return new Promise(resolve => setTimeout(resolve, ms));
26
+ }
27
+ exports.fetchJson = async (url, options) => {
28
+ try {
29
+ options ? options : {}
30
+ const res = await axios({
31
+ method: 'GET',
32
+ url: url,
33
+ headers: {
34
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'
35
+ },
36
+ ...options
37
+ })
38
+ return res.data
39
+ } catch (err) {
40
+ return err
41
+ }
42
+ }
43
+ exports.fetchBuffer = async (url, options) => {
44
+ try {
45
+ options ? options : {}
46
+ const res = await axios({
47
+ method: "GET",
48
+ url,
49
+ headers: {
50
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36",
51
+ 'DNT': 1,
52
+ 'Upgrade-Insecure-Request': 1
53
+ },
54
+ ...options,
55
+ responseType: 'arraybuffer'
56
+ })
57
+ return res.data
58
+ } catch (err) {
59
+ return err
60
+ }
61
+ }
62
+ exports.webp2mp4File=async(path) =>{
63
+ return new Promise((resolve, reject) => {
64
+ const form = new BodyForm()
65
+ form.append('new-image-url', '')
66
+ form.append('new-image', fs.createReadStream(path))
67
+ axios({
68
+ method: 'post',
69
+ url: 'https://s6.ezgif.com/webp-to-mp4',
70
+ data: form,
71
+ headers: {
72
+ 'Content-Type': `multipart/form-data; boundary=${form._boundary}`
73
+ }
74
+ }).then(({ data }) => {
75
+ const bodyFormThen = new BodyForm()
76
+ const $ = cheerio.load(data)
77
+ const file = $('input[name="file"]').attr('value')
78
+ bodyFormThen.append('file', file)
79
+ bodyFormThen.append('convert', "Convert WebP to MP4!")
80
+ axios({
81
+ method: 'post',
82
+ url: 'https://ezgif.com/webp-to-mp4/' + file,
83
+ data: bodyFormThen,
84
+ headers: {
85
+ 'Content-Type': `multipart/form-data; boundary=${bodyFormThen._boundary}`
86
+ }
87
+ }).then(({ data }) => {
88
+ const $ = cheerio.load(data)
89
+ const result = 'https:' + $('div#output > p.outfile > video > source').attr('src')
90
+ resolve({
91
+ status: true,
92
+ message: "Created By Eternity",
93
+ result: result
94
+ })
95
+ }).catch(reject)
96
+ }).catch(reject)
97
+ })
98
+ }
99
+
100
+ exports.fetchUrl = async (url, options) => {
101
+ try {
102
+ options ? options : {}
103
+ const res = await axios({
104
+ method: 'GET',
105
+ url: url,
106
+ headers: {
107
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'
108
+ },
109
+ ...options
110
+ })
111
+ return res.data
112
+ } catch (err) {
113
+ return err
114
+ }
115
+ }
116
+
117
+ exports.WAVersion = async () => {
118
+ let get = await exports.fetchUrl("https://web.whatsapp.com/check-update?version=1&platform=web")
119
+ let version = [get.currentVersion.replace(/[.]/g, ", ")]
120
+ return version
121
+ }
122
+
123
+ exports.getRandom = (ext) => {
124
+ return `${Math.floor(Math.random() * 10000)}${ext}`
125
+ }
126
+
127
+ exports.isUrl = (url) => {
128
+ return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/, 'gi'))
129
+ }
130
+
131
+ exports.isNumber = (number) => {
132
+ const int = parseInt(number)
133
+ return typeof int === 'number' && !isNaN(int)
134
+ }
135
+ exports.TelegraPh= (Path) =>{
136
+ return new Promise (async (resolve, reject) => {
137
+ if (!fs.existsSync(Path)) return reject(new Error("File not Found"))
138
+ try {
139
+ const form = new BodyForm();
140
+ form.append("file", fs.createReadStream(Path))
141
+ const data = await axios({
142
+ url: "https://telegra.ph/upload",
143
+ method: "POST",
144
+ headers: {
145
+ ...form.getHeaders()
146
+ },
147
+ data: form
148
+ })
149
+ return resolve("https://telegra.ph" + data.data[0].src)
150
+ } catch (err) {
151
+ return reject(new Error(String(err)))
152
+ }
153
+ })
154
+ }
155
+ const sleepy = async (ms) => {
156
+ return new Promise(resolve => setTimeout(resolve, ms));
157
+ }
158
+ exports.buffergif = async (image) => {
159
+
160
+ const filename = `${Math.random().toString(36)}`
161
+ await fs.writeFileSync(`./XeonMedia/trash/${filename}.gif`, image)
162
+ child_process.exec(
163
+ `ffmpeg -i ./XeonMedia/trash/${filename}.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" ./XeonMedia/trash/${filename}.mp4`
164
+ )
165
+ await sleepy(4000)
166
+
167
+ var buffer5 = await fs.readFileSync(`./XeonMedia/trash/${filename}.mp4`)
168
+ Promise.all([unlink(`./XeonMedia/video/${filename}.mp4`), unlink(`./XeonMedia/gif/${filename}.gif`)])
169
+ return buffer5
170
+ }
@@ -0,0 +1,180 @@
1
+ const { getOwnerConfig, setOwnerConfig } = require('../Database/settingsStore');
2
+
3
+ const defaultEmojis = ['šŸ’ž', 'šŸ’˜', '🄰', 'šŸ’™','šŸ’“','šŸ’•'];
4
+
5
+ function loadAutoReactionState() {
6
+ try {
7
+ const config = getOwnerConfig('autoReaction');
8
+ if (config && typeof config === 'object') {
9
+ return {
10
+ enabled: config.enabled || false,
11
+ customReactions: Array.isArray(config.customReactions)
12
+ ? config.customReactions
13
+ : defaultEmojis
14
+ };
15
+ }
16
+ } catch (error) {
17
+ console.error('Error loading auto-reaction state:', error);
18
+ }
19
+ return {
20
+ enabled: false,
21
+ customReactions: defaultEmojis
22
+ };
23
+ }
24
+
25
+ function saveAutoReactionState(state, customReactions = null) {
26
+ try {
27
+ const current = loadAutoReactionState();
28
+
29
+ const reactionsToSave = Array.isArray(customReactions)
30
+ ? customReactions
31
+ : current.customReactions;
32
+
33
+ const newConfig = {
34
+ enabled: state,
35
+ customReactions: reactionsToSave
36
+ };
37
+
38
+ setOwnerConfig('autoReaction', newConfig);
39
+ } catch (error) {
40
+ console.error('Error saving auto-reaction state:', error);
41
+ }
42
+ }
43
+
44
+ function refreshAutoReactionConfig() {
45
+ autoReactionConfig = loadAutoReactionState();
46
+ }
47
+
48
+ // Store auto-reaction state
49
+ let autoReactionConfig = loadAutoReactionState();
50
+
51
+ // Function to get random emoji from custom reactions
52
+ function getRandomEmoji() {
53
+ const reactions = autoReactionConfig.customReactions;
54
+ // Additional safety check to ensure it's an array
55
+ if (!Array.isArray(reactions) || reactions.length === 0) {
56
+ return defaultEmojis[Math.floor(Math.random() * defaultEmojis.length)];
57
+ }
58
+ return reactions[Math.floor(Math.random() * reactions.length)];
59
+ }
60
+
61
+ // Function to add reaction to a command message
62
+ async function addCommandReaction(sock, message) {
63
+ try {
64
+ if (!autoReactionConfig.enabled || !message?.key?.id) return;
65
+
66
+ const emoji = getRandomEmoji();
67
+ await sock.sendMessage(message.key.remoteJid, {
68
+ react: {
69
+ text: emoji,
70
+ key: message.key
71
+ }
72
+ });
73
+ } catch (error) {
74
+ console.error('Error adding command reaction:', error);
75
+ }
76
+ }
77
+
78
+ // Function to handle areact command
79
+ async function handleAreactCommand(sock, chatId, message, isOwner) {
80
+ try {
81
+ if (!isOwner) {
82
+ await sock.sendMessage(chatId, {
83
+ text: 'āŒ This command is only available for the owner!',
84
+ quoted: message
85
+ });
86
+ return;
87
+ }
88
+
89
+ const messageText = message.message?.conversation || message.message?.extendedTextMessage?.text || '';
90
+ const args = messageText.split(' ');
91
+ const action = args[1]?.toLowerCase();
92
+
93
+ if (action === 'on') {
94
+ autoReactionConfig.enabled = true;
95
+ saveAutoReactionState(true, autoReactionConfig.customReactions);
96
+ await sock.sendMessage(chatId, {
97
+ text: 'āœ… Auto-reactions have been enabled globally\n\nCustom reactions will be used for all commands!',
98
+ quoted: message
99
+ });
100
+ } else if (action === 'off') {
101
+ autoReactionConfig.enabled = false;
102
+ saveAutoReactionState(false, autoReactionConfig.customReactions);
103
+ await sock.sendMessage(chatId, {
104
+ text: 'āœ… Auto-reactions have been disabled globally',
105
+ quoted: message
106
+ });
107
+ } else if (action === 'set') {
108
+ // Handle custom reaction setting
109
+ const customReactions = args.slice(2);
110
+
111
+ if (customReactions.length === 0) {
112
+ await sock.sendMessage(chatId, {
113
+ text: 'āŒ Please provide at least one emoji!\n\nExample: `.areact set šŸŽ‰ šŸš€ ⭐`',
114
+ quoted: message
115
+ });
116
+ return;
117
+ }
118
+
119
+ // Validate emojis (basic check)
120
+ const validEmojis = customReactions.filter(emoji =>
121
+ emoji.length <= 4 && /[\p{Emoji}]/u.test(emoji)
122
+ );
123
+
124
+ if (validEmojis.length === 0) {
125
+ await sock.sendMessage(chatId, {
126
+ text: 'āŒ Please provide valid emojis!',
127
+ quoted: message
128
+ });
129
+ return;
130
+ }
131
+
132
+ autoReactionConfig.customReactions = validEmojis;
133
+ saveAutoReactionState(autoReactionConfig.enabled, validEmojis);
134
+
135
+ await sock.sendMessage(chatId, {
136
+ text: `āœ… Custom reactions updated!\n\nNew reactions: ${validEmojis.join(' ')}\n\nAuto-reactions are currently ${autoReactionConfig.enabled ? 'enabled' : 'disabled'}`},
137
+ { quoted: message
138
+ });
139
+ } else if (action === 'reset') {
140
+ // Reset to default reactions
141
+ autoReactionConfig.customReactions = defaultEmojis;
142
+ saveAutoReactionState(autoReactionConfig.enabled, defaultEmojis);
143
+
144
+ await sock.sendMessage(chatId, {
145
+ text: `āœ… Custom reactions reset to default!\n\nDefault reactions: ${defaultEmojis.join(' ')}`,
146
+ quoted: message
147
+ });
148
+ } else if (action === 'list') {
149
+ // Show current custom reactions
150
+ const currentReactions = autoReactionConfig.customReactions.join(' ');
151
+ await sock.sendMessage(chatId, {
152
+ text: `šŸ“‹ Current custom reactions:\n\n${currentReactions}\n\nAuto-reactions are ${autoReactionConfig.enabled ? 'āœ… enabled' : 'āŒ disabled'}`,
153
+ quoted: message
154
+ });
155
+ } else {
156
+ // Show help
157
+ const currentState = autoReactionConfig.enabled ? 'enabled' : 'disabled';
158
+ const currentReactions = autoReactionConfig.customReactions.join(' ');
159
+
160
+ await sock.sendMessage(chatId, {
161
+ text: `āš™ļø Auto-reactions are currently **${currentState}** globally.\n\nšŸ“‹ Current reactions: ${currentReactions}\n\n**Commands:**\n• \`.areact on\` - Enable auto-reactions\n• \`.areact off\` - Disable auto-reactions\n• \`.areact set <emojis>\` - Set custom reactions\n• \`.areact reset\` - Reset to default reactions\n• \`.areact list\` - Show current reactions\n\n**Example:**\n\`.areact set šŸŽ‰ šŸš€ ⭐ šŸ’«\``},
162
+ { quoted: message
163
+ });
164
+ }
165
+ } catch (error) {
166
+ console.error('Error handling areact command:', error);
167
+ await sock.sendMessage(chatId, {
168
+ text: 'āŒ Error controlling auto-reactions',
169
+ quoted: message
170
+ });
171
+ }
172
+ }
173
+
174
+ module.exports = {
175
+ addCommandReaction,
176
+ handleAreactCommand,
177
+ refreshAutoReactionConfig,
178
+ getAutoReactionConfig: () => autoReactionConfig,
179
+ defaultEmojis
180
+ };