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.
- package/Database/database.js +446 -0
- package/Database/migration.js +327 -0
- package/Database/pgSync.js +229 -0
- package/Database/settingsStore.js +305 -0
- package/config.js +32 -0
- package/dave.js +3063 -0
- package/davelib/antibadword.js +278 -0
- package/davelib/antilink.js +88 -0
- package/davelib/antilinkHelper.js +48 -0
- package/davelib/botConfig.js +71 -0
- package/davelib/connect4.js +111 -0
- package/davelib/converter.js +89 -0
- package/davelib/dicegame.js +114 -0
- package/davelib/exif.js +138 -0
- package/davelib/fakeContact.js +85 -0
- package/davelib/fontStyles.js +237 -0
- package/davelib/greetings.js +47 -0
- package/davelib/id.js +11 -0
- package/davelib/index.js +577 -0
- package/davelib/isAdmin.js +32 -0
- package/davelib/isBanned.js +12 -0
- package/davelib/isOwner.js +15 -0
- package/davelib/lightweight_store.js +169 -0
- package/davelib/messageConfig.js +15 -0
- package/davelib/messageHandler.js +87 -0
- package/davelib/myfunc.js +379 -0
- package/davelib/myfunc2.js +170 -0
- package/davelib/reactions.js +180 -0
- package/davelib/server.html +563 -0
- package/davelib/sticker.js +208 -0
- package/davelib/tempCleanup.js +53 -0
- package/davelib/tictactoe.js +104 -0
- package/davelib/uploadImage.js +100 -0
- package/davelib/uploader.js +110 -0
- package/davelib/welcome.js +100 -0
- package/davelib/wordchain.js +121 -0
- package/daveset.js +16 -0
- package/davexcore/ai/ai.js +100 -0
- package/davexcore/ai/aiGpt4.js +59 -0
- package/davexcore/ai/aimodels.js +284 -0
- package/davexcore/ai/aivideo.js +31 -0
- package/davexcore/ai/analyze.js +233 -0
- package/davexcore/ai/bard.js +101 -0
- package/davexcore/ai/bird.js +101 -0
- package/davexcore/ai/blackbox.js +30 -0
- package/davexcore/ai/character.js +80 -0
- package/davexcore/ai/copilot.js +58 -0
- package/davexcore/ai/dalle.js +39 -0
- package/davexcore/ai/davex.js +50 -0
- package/davexcore/ai/deepseek.js +96 -0
- package/davexcore/ai/grok.js +67 -0
- package/davexcore/ai/imagine.js +89 -0
- package/davexcore/ai/meta.js +82 -0
- package/davexcore/ai/mistral.js +101 -0
- package/davexcore/ai/perplexity.js +95 -0
- package/davexcore/ai/sora.js +44 -0
- package/davexcore/ai/speechwriter.js +46 -0
- package/davexcore/ai/vision.js +244 -0
- package/davexcore/ai/wormgpt.js +56 -0
- package/davexcore/anti/antiaudio.js +106 -0
- package/davexcore/anti/antibadword.js +313 -0
- package/davexcore/anti/antibug.js +156 -0
- package/davexcore/anti/anticall.js +219 -0
- package/davexcore/anti/antichart.js +280 -0
- package/davexcore/anti/antidelete.js +673 -0
- package/davexcore/anti/antideletestatus.js +535 -0
- package/davexcore/anti/antidemote.js +352 -0
- package/davexcore/anti/antidocument.js +105 -0
- package/davexcore/anti/antiedit.js +410 -0
- package/davexcore/anti/antifiles.js +109 -0
- package/davexcore/anti/antigroupmention.js +206 -0
- package/davexcore/anti/antiimage.js +105 -0
- package/davexcore/anti/antikick.js +125 -0
- package/davexcore/anti/antilink.js +237 -0
- package/davexcore/anti/antimention.js +143 -0
- package/davexcore/anti/antipromote.js +320 -0
- package/davexcore/anti/antisticker.js +105 -0
- package/davexcore/anti/antitag.js +191 -0
- package/davexcore/anti/antivideo.js +105 -0
- package/davexcore/anti/antiviewonce.js +396 -0
- package/davexcore/anti/groupanticall.js +262 -0
- package/davexcore/anti/mention.js +242 -0
- package/davexcore/automation/alwaysonline.js +226 -0
- package/davexcore/automation/autoReadReciepts.js +96 -0
- package/davexcore/automation/autoread.js +104 -0
- package/davexcore/automation/autorecording.js +197 -0
- package/davexcore/automation/autostatus.js +317 -0
- package/davexcore/automation/autotyping.js +197 -0
- package/davexcore/automation/chatbot.js +444 -0
- package/davexcore/automation/chatmanage.js +199 -0
- package/davexcore/automation/devReact.js +43 -0
- package/davexcore/automation/goodbye.js +181 -0
- package/davexcore/automation/greetings.js +154 -0
- package/davexcore/automation/welcome.js +187 -0
- package/davexcore/downloads/apk.js +157 -0
- package/davexcore/downloads/facebook.js +94 -0
- package/davexcore/downloads/gitclone.js +137 -0
- package/davexcore/downloads/igs.js +333 -0
- package/davexcore/downloads/instagram.js +133 -0
- package/davexcore/downloads/mediafire.js +144 -0
- package/davexcore/downloads/pinterest.js +38 -0
- package/davexcore/downloads/play.js +158 -0
- package/davexcore/downloads/saveStatus.js +3 -0
- package/davexcore/downloads/song.js +135 -0
- package/davexcore/downloads/spotify.js +133 -0
- package/davexcore/downloads/tiktok.js +167 -0
- package/davexcore/downloads/tiktokaudio.js +158 -0
- package/davexcore/downloads/video.js +188 -0
- package/davexcore/downloads/ytdl.js +252 -0
- package/davexcore/downloads/ytdocplay.js +130 -0
- package/davexcore/downloads/ytdocvideo.js +95 -0
- package/davexcore/downloads/yts.js +64 -0
- package/davexcore/games/connect4.js +267 -0
- package/davexcore/games/dice.js +286 -0
- package/davexcore/games/eightball.js +24 -0
- package/davexcore/games/hangman.js +60 -0
- package/davexcore/games/rps.js +25 -0
- package/davexcore/games/ship.js +36 -0
- package/davexcore/games/slot.js +21 -0
- package/davexcore/games/tictactoe.js +263 -0
- package/davexcore/games/trivia.js +46 -0
- package/davexcore/games/wordchain.js +242 -0
- package/davexcore/group/addmember.js +101 -0
- package/davexcore/group/ban.js +63 -0
- package/davexcore/group/blockUnblock.js +177 -0
- package/davexcore/group/clear.js +196 -0
- package/davexcore/group/creategroup.js +43 -0
- package/davexcore/group/demote.js +115 -0
- package/davexcore/group/disappear.js +67 -0
- package/davexcore/group/groupinfo.js +167 -0
- package/davexcore/group/groupmanage.js +133 -0
- package/davexcore/group/hidetag.js +108 -0
- package/davexcore/group/joinrequests.js +145 -0
- package/davexcore/group/kick.js +92 -0
- package/davexcore/group/kickall.js +63 -0
- package/davexcore/group/leave.js +38 -0
- package/davexcore/group/linkgroup.js +63 -0
- package/davexcore/group/mute.js +57 -0
- package/davexcore/group/online.js +117 -0
- package/davexcore/group/pmblocker.js +65 -0
- package/davexcore/group/promote.js +93 -0
- package/davexcore/group/resetlink.js +57 -0
- package/davexcore/group/staff.js +99 -0
- package/davexcore/group/tag.js +111 -0
- package/davexcore/group/tagadmins.js +88 -0
- package/davexcore/group/tagall.js +99 -0
- package/davexcore/group/tagnotadmin.js +92 -0
- package/davexcore/group/topmembers.js +202 -0
- package/davexcore/group/unban.js +64 -0
- package/davexcore/group/unmute.js +45 -0
- package/davexcore/group/warn.js +83 -0
- package/davexcore/group/warnings.js +26 -0
- package/davexcore/media/anime.js +130 -0
- package/davexcore/media/attp.js +127 -0
- package/davexcore/media/design.js +52 -0
- package/davexcore/media/emojimix.js +105 -0
- package/davexcore/media/getpp.js +108 -0
- package/davexcore/media/image.js +87 -0
- package/davexcore/media/imageedit.js +329 -0
- package/davexcore/media/img-blur.js +70 -0
- package/davexcore/media/meme.js +35 -0
- package/davexcore/media/pies.js +53 -0
- package/davexcore/media/quotesticker.js +153 -0
- package/davexcore/media/remini.js +126 -0
- package/davexcore/media/removebg.js +114 -0
- package/davexcore/media/setpp.js +65 -0
- package/davexcore/media/shazam.js +251 -0
- package/davexcore/media/simage.js +74 -0
- package/davexcore/media/sticker.js +134 -0
- package/davexcore/media/stickercrop.js +133 -0
- package/davexcore/media/stickertelegram.js +133 -0
- package/davexcore/media/take.js +76 -0
- package/davexcore/media/textmaker.js +106 -0
- package/davexcore/media/toAudio.js +180 -0
- package/davexcore/media/togif.js +33 -0
- package/davexcore/media/toimg.js +26 -0
- package/davexcore/media/tomp4.js +34 -0
- package/davexcore/media/tostatus.js +160 -0
- package/davexcore/media/tts.js +47 -0
- package/davexcore/media/viewonce.js +59 -0
- package/davexcore/media/vn.js +67 -0
- package/davexcore/media/vv2.js +3 -0
- package/davexcore/media/wallpaper.js +89 -0
- package/davexcore/media/wasted.js +57 -0
- package/davexcore/misc/compliment.js +93 -0
- package/davexcore/misc/dare.js +47 -0
- package/davexcore/misc/fact.js +14 -0
- package/davexcore/misc/flirt.js +26 -0
- package/davexcore/misc/goodnight.js +33 -0
- package/davexcore/misc/insult.js +281 -0
- package/davexcore/misc/joke.js +66 -0
- package/davexcore/misc/misc.js +200 -0
- package/davexcore/misc/quote.js +22 -0
- package/davexcore/misc/roseday.js +24 -0
- package/davexcore/misc/shayari.js +62 -0
- package/davexcore/misc/simp.js +47 -0
- package/davexcore/misc/stupid.js +51 -0
- package/davexcore/misc/truth.js +146 -0
- package/davexcore/owner/alive.js +67 -0
- package/davexcore/owner/bio.js +49 -0
- package/davexcore/owner/broadcast.js +74 -0
- package/davexcore/owner/chanel.js +79 -0
- package/davexcore/owner/channelid.js +50 -0
- package/davexcore/owner/clearsession.js +86 -0
- package/davexcore/owner/help.js +649 -0
- package/davexcore/owner/hijack.js +69 -0
- package/davexcore/owner/menuManage.js +173 -0
- package/davexcore/owner/menuSettings.js +1 -0
- package/davexcore/owner/owner.js +17 -0
- package/davexcore/owner/pair.js +160 -0
- package/davexcore/owner/pinchat.js +44 -0
- package/davexcore/owner/ping.js +65 -0
- package/davexcore/owner/profilepic.js +61 -0
- package/davexcore/owner/resetmenuimage.js +16 -0
- package/davexcore/owner/setGroupStatus.js +315 -0
- package/davexcore/owner/setbotconfig.js +306 -0
- package/davexcore/owner/setfont.js +79 -0
- package/davexcore/owner/setowner.js +144 -0
- package/davexcore/owner/setprefix.js +131 -0
- package/davexcore/owner/settings.js +98 -0
- package/davexcore/owner/startupwelcome.js +94 -0
- package/davexcore/owner/sudo.js +138 -0
- package/davexcore/owner/update.js +282 -0
- package/davexcore/tmp/1772020249097.jpg +0 -0
- package/davexcore/utility/bible.js +239 -0
- package/davexcore/utility/cleartmp.js +107 -0
- package/davexcore/utility/delete.js +182 -0
- package/davexcore/utility/encrypt.js +99 -0
- package/davexcore/utility/ethicalhacking.js +108 -0
- package/davexcore/utility/fetch.js +127 -0
- package/davexcore/utility/github.js +85 -0
- package/davexcore/utility/google.js +79 -0
- package/davexcore/utility/join.js +52 -0
- package/davexcore/utility/lastseen.js +67 -0
- package/davexcore/utility/location.js +106 -0
- package/davexcore/utility/lyrics.js +54 -0
- package/davexcore/utility/movie.js +66 -0
- package/davexcore/utility/news.js +37 -0
- package/davexcore/utility/sports.js +403 -0
- package/davexcore/utility/ss.js +63 -0
- package/davexcore/utility/tinyurl.js +83 -0
- package/davexcore/utility/translate.js +101 -0
- package/davexcore/utility/url.js +112 -0
- package/davexcore/utility/vcf.js +84 -0
- package/davexcore/utility/weather.js +162 -0
- package/index.js +994 -0
- package/package.json +64 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
const { getOwnerConfig, setOwnerConfig, parseToggleCommand } = require('../../Database/settingsStore');
|
|
2
|
+
const db = require('../../Database/database');
|
|
3
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
4
|
+
|
|
5
|
+
const recordingIntervals = new Map();
|
|
6
|
+
|
|
7
|
+
async function isAuthorized(sock, message) {
|
|
8
|
+
try {
|
|
9
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
10
|
+
if (message.key.fromMe) return true;
|
|
11
|
+
return db.isSudo(senderId);
|
|
12
|
+
} catch {
|
|
13
|
+
return message.key.fromMe;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function autorecordingCommand(sock, chatId, message) {
|
|
18
|
+
try {
|
|
19
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
20
|
+
const fake = createFakeContact(senderId);
|
|
21
|
+
const botName = getBotName();
|
|
22
|
+
|
|
23
|
+
if (!await isAuthorized(sock, message)) {
|
|
24
|
+
await sock.sendMessage(chatId, {
|
|
25
|
+
text: `✦ Owner only command`
|
|
26
|
+
}, { quoted: fake });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const text = message.message?.conversation || message.message?.extendedTextMessage?.text || '';
|
|
31
|
+
const args = text.trim().split(/\s+/).slice(1);
|
|
32
|
+
const action = args[0]?.toLowerCase();
|
|
33
|
+
const action2 = args[1]?.toLowerCase();
|
|
34
|
+
|
|
35
|
+
const config = getOwnerConfig('autorecording') || { enabled: false, pm: true, group: true };
|
|
36
|
+
|
|
37
|
+
if (!action) {
|
|
38
|
+
const helpText = `✦ *AUTORECORDING*
|
|
39
|
+
|
|
40
|
+
Status: ${config.enabled ? 'ON' : 'OFF'}
|
|
41
|
+
PM: ${config.pm ? 'ON' : 'OFF'}
|
|
42
|
+
Group: ${config.group ? 'ON' : 'OFF'}
|
|
43
|
+
|
|
44
|
+
✦ *Commands:*
|
|
45
|
+
› on
|
|
46
|
+
› off
|
|
47
|
+
› pm
|
|
48
|
+
› group
|
|
49
|
+
› both
|
|
50
|
+
› pm on/off
|
|
51
|
+
› group on/off
|
|
52
|
+
› both on/off`;
|
|
53
|
+
await sock.sendMessage(chatId, { text: helpText }, { quoted: fake });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let newConfig = { ...config };
|
|
58
|
+
let responseText = '';
|
|
59
|
+
|
|
60
|
+
const toggle = parseToggleCommand(action);
|
|
61
|
+
|
|
62
|
+
if (toggle === 'on') {
|
|
63
|
+
newConfig.enabled = true;
|
|
64
|
+
newConfig.pm = true;
|
|
65
|
+
newConfig.group = true;
|
|
66
|
+
responseText = `✦ Autorecording ENABLED for both PMs & Groups`;
|
|
67
|
+
} else if (toggle === 'off') {
|
|
68
|
+
newConfig.enabled = false;
|
|
69
|
+
stopAllRecordingIntervals();
|
|
70
|
+
responseText = `✦ Autorecording DISABLED`;
|
|
71
|
+
} else if (action === 'pm') {
|
|
72
|
+
const toggle2 = action2 ? parseToggleCommand(action2) : null;
|
|
73
|
+
if (toggle2 === 'off') {
|
|
74
|
+
newConfig.pm = false;
|
|
75
|
+
if (!newConfig.group) newConfig.enabled = false;
|
|
76
|
+
responseText = `✦ Autorecording PM mode DISABLED\n Group: ${newConfig.group ? 'ON' : 'OFF'}`;
|
|
77
|
+
} else {
|
|
78
|
+
newConfig.pm = true;
|
|
79
|
+
newConfig.group = false;
|
|
80
|
+
newConfig.enabled = true;
|
|
81
|
+
responseText = `✦ Autorecording enabled for PMs only`;
|
|
82
|
+
if (toggle2 === 'on') {
|
|
83
|
+
newConfig.group = config.group;
|
|
84
|
+
responseText = `✦ Autorecording PM mode ENABLED\n Group: ${newConfig.group ? 'ON' : 'OFF'}`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} else if (action === 'group') {
|
|
88
|
+
const toggle2 = action2 ? parseToggleCommand(action2) : null;
|
|
89
|
+
if (toggle2 === 'off') {
|
|
90
|
+
newConfig.group = false;
|
|
91
|
+
if (!newConfig.pm) newConfig.enabled = false;
|
|
92
|
+
responseText = `✦ Autorecording Group mode DISABLED\n PM: ${newConfig.pm ? 'ON' : 'OFF'}`;
|
|
93
|
+
} else {
|
|
94
|
+
newConfig.group = true;
|
|
95
|
+
newConfig.pm = false;
|
|
96
|
+
newConfig.enabled = true;
|
|
97
|
+
responseText = `✦ Autorecording enabled for Groups only`;
|
|
98
|
+
if (toggle2 === 'on') {
|
|
99
|
+
newConfig.pm = config.pm;
|
|
100
|
+
responseText = `✦ Autorecording Group mode ENABLED\n PM: ${newConfig.pm ? 'ON' : 'OFF'}`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
} else if (action === 'both') {
|
|
104
|
+
const toggle2 = action2 ? parseToggleCommand(action2) : null;
|
|
105
|
+
if (toggle2 === 'off') {
|
|
106
|
+
newConfig.enabled = false;
|
|
107
|
+
newConfig.pm = false;
|
|
108
|
+
newConfig.group = false;
|
|
109
|
+
stopAllRecordingIntervals();
|
|
110
|
+
responseText = `✦ Autorecording DISABLED for both PMs & Groups`;
|
|
111
|
+
} else {
|
|
112
|
+
newConfig.pm = true;
|
|
113
|
+
newConfig.group = true;
|
|
114
|
+
newConfig.enabled = true;
|
|
115
|
+
responseText = `✦ Autorecording enabled for both PMs & Groups`;
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
responseText = `✦ Invalid! Use: on, off, pm, group, both\n Or: pm on/off, group on/off, both on/off`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (responseText && !responseText.includes('Invalid')) {
|
|
122
|
+
if (!newConfig.pm && !newConfig.group) {
|
|
123
|
+
newConfig.enabled = false;
|
|
124
|
+
stopAllRecordingIntervals();
|
|
125
|
+
}
|
|
126
|
+
setOwnerConfig('autorecording', newConfig);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
await sock.sendMessage(chatId, { text: responseText }, { quoted: fake });
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error('Error in autorecording command:', error.message, 'Line:', error.stack?.split('\n')[1]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function isAutorecordingEnabled() {
|
|
136
|
+
const config = getOwnerConfig('autorecording');
|
|
137
|
+
return config?.enabled || false;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function stopAllRecordingIntervals() {
|
|
141
|
+
for (const [key, interval] of recordingIntervals.entries()) {
|
|
142
|
+
clearInterval(interval);
|
|
143
|
+
recordingIntervals.delete(key);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function handleAutorecordingForMessage(sock, chatId) {
|
|
148
|
+
try {
|
|
149
|
+
const config = getOwnerConfig('autorecording');
|
|
150
|
+
if (!config?.enabled) return;
|
|
151
|
+
|
|
152
|
+
const isGroup = chatId.endsWith('@g.us');
|
|
153
|
+
if (isGroup && !config.group) return;
|
|
154
|
+
if (!isGroup && !config.pm) return;
|
|
155
|
+
|
|
156
|
+
if (recordingIntervals.has(chatId)) {
|
|
157
|
+
clearInterval(recordingIntervals.get(chatId));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
await sock.presenceSubscribe(chatId);
|
|
161
|
+
await sock.sendPresenceUpdate('recording', chatId);
|
|
162
|
+
|
|
163
|
+
const interval = setInterval(async () => {
|
|
164
|
+
try {
|
|
165
|
+
const currentConfig = getOwnerConfig('autorecording');
|
|
166
|
+
if (!currentConfig?.enabled) {
|
|
167
|
+
clearInterval(interval);
|
|
168
|
+
recordingIntervals.delete(chatId);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
await sock.sendPresenceUpdate('recording', chatId);
|
|
172
|
+
} catch (e) {
|
|
173
|
+
clearInterval(interval);
|
|
174
|
+
recordingIntervals.delete(chatId);
|
|
175
|
+
}
|
|
176
|
+
}, 4000);
|
|
177
|
+
|
|
178
|
+
recordingIntervals.set(chatId, interval);
|
|
179
|
+
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
if (recordingIntervals.has(chatId)) {
|
|
182
|
+
clearInterval(recordingIntervals.get(chatId));
|
|
183
|
+
recordingIntervals.delete(chatId);
|
|
184
|
+
try { sock.sendPresenceUpdate('paused', chatId); } catch(e) {}
|
|
185
|
+
}
|
|
186
|
+
}, 30000);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
console.error('Autorecording error:', error.message);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
module.exports = {
|
|
193
|
+
autorecordingCommand,
|
|
194
|
+
isAutorecordingEnabled,
|
|
195
|
+
handleAutorecordingForMessage,
|
|
196
|
+
stopAllRecordingIntervals
|
|
197
|
+
};
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
const { getOwnerConfig, setOwnerConfig } = require('../../Database/settingsStore');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
const { isSudo } = require('../../davelib/index');
|
|
4
|
+
|
|
5
|
+
const emojis = ['❤️', '😂', '😮', '😢', '😡', '👏', '🔥', '⭐', '🎉', '🙏'];
|
|
6
|
+
|
|
7
|
+
function getRandomEmoji() {
|
|
8
|
+
return emojis[Math.floor(Math.random() * emojis.length)];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const DEFAULT_AUTOSTATUS_CONFIG = {
|
|
12
|
+
enabled: true,
|
|
13
|
+
reactOn: false,
|
|
14
|
+
reactionEmoji: '🖤',
|
|
15
|
+
randomReactions: true
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function readConfig() {
|
|
19
|
+
try {
|
|
20
|
+
const config = getOwnerConfig('autostatus');
|
|
21
|
+
if (!config || typeof config !== 'object') {
|
|
22
|
+
return { ...DEFAULT_AUTOSTATUS_CONFIG };
|
|
23
|
+
}
|
|
24
|
+
return { ...DEFAULT_AUTOSTATUS_CONFIG, ...config };
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('Config error:', error);
|
|
27
|
+
return { ...DEFAULT_AUTOSTATUS_CONFIG };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function writeConfig(config) {
|
|
32
|
+
try {
|
|
33
|
+
setOwnerConfig('autostatus', config);
|
|
34
|
+
return true;
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error('Config write error:', error);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function autoStatusCommand(sock, chatId, msg, args) {
|
|
42
|
+
try {
|
|
43
|
+
const fakeContact = createFakeContact(msg);
|
|
44
|
+
const senderId = msg.key.participant || msg.key.remoteJid;
|
|
45
|
+
const senderIsSudo = await isSudo(senderId);
|
|
46
|
+
const isOwner = msg.key.fromMe || senderIsSudo;
|
|
47
|
+
|
|
48
|
+
if (!isOwner) {
|
|
49
|
+
await sock.sendMessage(chatId, { text: `✦ Owner only command` }, { quoted: fakeContact });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let config = readConfig();
|
|
54
|
+
|
|
55
|
+
if (!args || args.length === 0) {
|
|
56
|
+
const text = `✦ *AUTO STATUS*
|
|
57
|
+
|
|
58
|
+
✓ Status: ${config.enabled ? 'ON' : 'OFF'}
|
|
59
|
+
✓ Reactions: ${config.reactOn ? 'ON' : 'OFF'}
|
|
60
|
+
✓ Emoji: ${config.reactionEmoji}
|
|
61
|
+
✓ Random: ${config.randomReactions ? 'ON' : 'OFF'}
|
|
62
|
+
|
|
63
|
+
✦ *Commands:*
|
|
64
|
+
› on
|
|
65
|
+
› off
|
|
66
|
+
› react on/off
|
|
67
|
+
› emoji <emoji>
|
|
68
|
+
› random on/off
|
|
69
|
+
› reset`;
|
|
70
|
+
|
|
71
|
+
await sock.sendMessage(chatId, { text }, { quoted: fakeContact });
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const command = args[0].toLowerCase();
|
|
76
|
+
|
|
77
|
+
if (command === 'on') {
|
|
78
|
+
config.enabled = true;
|
|
79
|
+
if (writeConfig(config)) {
|
|
80
|
+
await sock.sendMessage(chatId, {
|
|
81
|
+
text: `✦ Auto Status ENABLED`
|
|
82
|
+
}, { quoted: fakeContact });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (command === 'off') {
|
|
86
|
+
config.enabled = false;
|
|
87
|
+
if (writeConfig(config)) {
|
|
88
|
+
await sock.sendMessage(chatId, {
|
|
89
|
+
text: `✦ Auto Status DISABLED`
|
|
90
|
+
}, { quoted: fakeContact });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else if (command === 'react') {
|
|
94
|
+
if (!args[1]) {
|
|
95
|
+
await sock.sendMessage(chatId, {
|
|
96
|
+
text: `✦ Use: react on/off`
|
|
97
|
+
}, { quoted: fakeContact });
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const reactCommand = args[1].toLowerCase();
|
|
102
|
+
if (reactCommand === 'on') {
|
|
103
|
+
config.reactOn = true;
|
|
104
|
+
if (writeConfig(config)) {
|
|
105
|
+
const reactionType = config.randomReactions ? 'random' : config.reactionEmoji;
|
|
106
|
+
await sock.sendMessage(chatId, {
|
|
107
|
+
text: `✦ Auto React ENABLED\n Type: ${reactionType}`
|
|
108
|
+
}, { quoted: fakeContact });
|
|
109
|
+
}
|
|
110
|
+
} else if (reactCommand === 'off') {
|
|
111
|
+
config.reactOn = false;
|
|
112
|
+
if (writeConfig(config)) {
|
|
113
|
+
await sock.sendMessage(chatId, {
|
|
114
|
+
text: `✦ Auto React DISABLED`
|
|
115
|
+
}, { quoted: fakeContact });
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
await sock.sendMessage(chatId, {
|
|
119
|
+
text: `✦ Invalid: react on/off`
|
|
120
|
+
}, { quoted: fakeContact });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else if (command === 'emoji') {
|
|
124
|
+
if (!args[1]) {
|
|
125
|
+
await sock.sendMessage(chatId, {
|
|
126
|
+
text: `✦ Emoji required`
|
|
127
|
+
}, { quoted: fakeContact });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const newEmoji = args[1].trim();
|
|
132
|
+
config.reactionEmoji = newEmoji;
|
|
133
|
+
if (writeConfig(config)) {
|
|
134
|
+
await sock.sendMessage(chatId, {
|
|
135
|
+
text: `✦ Emoji set: ${newEmoji}`
|
|
136
|
+
}, { quoted: fakeContact });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else if (command === 'random') {
|
|
140
|
+
if (!args[1]) {
|
|
141
|
+
await sock.sendMessage(chatId, {
|
|
142
|
+
text: `✦ Use: random on/off`
|
|
143
|
+
}, { quoted: fakeContact });
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const randomCommand = args[1].toLowerCase();
|
|
148
|
+
if (randomCommand === 'on') {
|
|
149
|
+
config.randomReactions = true;
|
|
150
|
+
if (writeConfig(config)) {
|
|
151
|
+
await sock.sendMessage(chatId, {
|
|
152
|
+
text: `✦ Random reactions ENABLED`
|
|
153
|
+
}, { quoted: fakeContact });
|
|
154
|
+
}
|
|
155
|
+
} else if (randomCommand === 'off') {
|
|
156
|
+
config.randomReactions = false;
|
|
157
|
+
if (writeConfig(config)) {
|
|
158
|
+
await sock.sendMessage(chatId, {
|
|
159
|
+
text: `✦ Random reactions DISABLED\n Using: ${config.reactionEmoji}`
|
|
160
|
+
}, { quoted: fakeContact });
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
await sock.sendMessage(chatId, {
|
|
164
|
+
text: `✦ Invalid: random on/off`
|
|
165
|
+
}, { quoted: fakeContact });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else if (command === 'reset') {
|
|
169
|
+
const defaultConfig = {
|
|
170
|
+
enabled: true,
|
|
171
|
+
reactOn: false,
|
|
172
|
+
reactionEmoji: '🖤',
|
|
173
|
+
randomReactions: true
|
|
174
|
+
};
|
|
175
|
+
if (writeConfig(defaultConfig)) {
|
|
176
|
+
await sock.sendMessage(chatId, {
|
|
177
|
+
text: `✦ Settings reset to default`
|
|
178
|
+
}, { quoted: fakeContact });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
await sock.sendMessage(chatId, {
|
|
183
|
+
text: `✦ Invalid command`
|
|
184
|
+
}, { quoted: fakeContact });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
} catch (error) {
|
|
188
|
+
console.error('AutoStatus error:', error);
|
|
189
|
+
const fakeContact = createFakeContact(msg);
|
|
190
|
+
await sock.sendMessage(chatId, { text: `✦ Error` }, { quoted: fakeContact });
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function isAutoStatusEnabled() {
|
|
195
|
+
try {
|
|
196
|
+
const config = readConfig();
|
|
197
|
+
return config.enabled;
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.error('Status check error:', error);
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function isStatusReactionEnabled() {
|
|
205
|
+
try {
|
|
206
|
+
const config = readConfig();
|
|
207
|
+
return config.reactOn;
|
|
208
|
+
} catch (error) {
|
|
209
|
+
console.error('Reaction check error:', error);
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function getReactionEmoji() {
|
|
215
|
+
try {
|
|
216
|
+
const config = readConfig();
|
|
217
|
+
|
|
218
|
+
if (config.randomReactions) {
|
|
219
|
+
return getRandomEmoji();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return config.reactionEmoji || '🖤';
|
|
223
|
+
} catch (error) {
|
|
224
|
+
console.error('Emoji error:', error);
|
|
225
|
+
return '🖤';
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function isRandomReactionsEnabled() {
|
|
230
|
+
try {
|
|
231
|
+
const config = readConfig();
|
|
232
|
+
return config.randomReactions !== false;
|
|
233
|
+
} catch (error) {
|
|
234
|
+
console.error('Random check error:', error);
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
async function reactToStatus(sock, statusKey) {
|
|
240
|
+
try {
|
|
241
|
+
if (!isStatusReactionEnabled()) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const emoji = getReactionEmoji();
|
|
246
|
+
|
|
247
|
+
await sock.relayMessage(
|
|
248
|
+
'status@broadcast',
|
|
249
|
+
{
|
|
250
|
+
reactionMessage: {
|
|
251
|
+
key: {
|
|
252
|
+
remoteJid: 'status@broadcast',
|
|
253
|
+
id: statusKey.id,
|
|
254
|
+
participant: statusKey.participant || statusKey.remoteJid,
|
|
255
|
+
fromMe: false
|
|
256
|
+
},
|
|
257
|
+
text: emoji
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
messageId: statusKey.id,
|
|
262
|
+
statusJidList: [statusKey.remoteJid, statusKey.participant || statusKey.remoteJid]
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
} catch (error) {
|
|
267
|
+
console.error('React error:', error.message);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
async function handleStatusUpdate(sock, status) {
|
|
272
|
+
try {
|
|
273
|
+
if (!isAutoStatusEnabled()) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
278
|
+
|
|
279
|
+
let statusKey = null;
|
|
280
|
+
|
|
281
|
+
if (status.messages && status.messages.length > 0) {
|
|
282
|
+
statusKey = status.messages[0].key;
|
|
283
|
+
} else if (status.key) {
|
|
284
|
+
statusKey = status.key;
|
|
285
|
+
} else if (status.reaction && status.reaction.key) {
|
|
286
|
+
statusKey = status.reaction.key;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (statusKey && statusKey.remoteJid === 'status@broadcast') {
|
|
290
|
+
try {
|
|
291
|
+
await sock.readMessages([statusKey]);
|
|
292
|
+
await reactToStatus(sock, statusKey);
|
|
293
|
+
|
|
294
|
+
} catch (err) {
|
|
295
|
+
if (err.message?.includes('rate-overlimit')) {
|
|
296
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
297
|
+
await sock.readMessages([statusKey]);
|
|
298
|
+
} else {
|
|
299
|
+
console.error('Status error:', err.message);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
} catch (error) {
|
|
305
|
+
console.error('Status update error:', error.message);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
module.exports = {
|
|
310
|
+
autoStatusCommand,
|
|
311
|
+
handleStatusUpdate,
|
|
312
|
+
isAutoStatusEnabled,
|
|
313
|
+
isStatusReactionEnabled,
|
|
314
|
+
getReactionEmoji,
|
|
315
|
+
isRandomReactionsEnabled,
|
|
316
|
+
getRandomEmoji
|
|
317
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
const { getOwnerConfig, setOwnerConfig, parseToggleCommand } = require('../../Database/settingsStore');
|
|
2
|
+
const db = require('../../Database/database');
|
|
3
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
4
|
+
|
|
5
|
+
const typingIntervals = new Map();
|
|
6
|
+
|
|
7
|
+
async function isAuthorized(sock, message) {
|
|
8
|
+
try {
|
|
9
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
10
|
+
if (message.key.fromMe) return true;
|
|
11
|
+
return db.isSudo(senderId);
|
|
12
|
+
} catch {
|
|
13
|
+
return message.key.fromMe;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function autotypingCommand(sock, chatId, message) {
|
|
18
|
+
try {
|
|
19
|
+
const senderId = message.key.participant || message.key.remoteJid;
|
|
20
|
+
const fake = createFakeContact(senderId);
|
|
21
|
+
const botName = getBotName();
|
|
22
|
+
|
|
23
|
+
if (!await isAuthorized(sock, message)) {
|
|
24
|
+
await sock.sendMessage(chatId, {
|
|
25
|
+
text: `✦ Owner only command`
|
|
26
|
+
}, { quoted: fake });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const text = message.message?.conversation || message.message?.extendedTextMessage?.text || '';
|
|
31
|
+
const args = text.trim().split(/\s+/).slice(1);
|
|
32
|
+
const action = args[0]?.toLowerCase();
|
|
33
|
+
const action2 = args[1]?.toLowerCase();
|
|
34
|
+
|
|
35
|
+
const config = getOwnerConfig('autotyping') || { enabled: false, duration: 3000, pm: true, group: true };
|
|
36
|
+
|
|
37
|
+
if (!action) {
|
|
38
|
+
const helpText = `✦ *AUTOTYPING*
|
|
39
|
+
|
|
40
|
+
Status: ${config.enabled ? 'ON' : 'OFF'}
|
|
41
|
+
PM: ${config.pm ? 'ON' : 'OFF'}
|
|
42
|
+
Group: ${config.group ? 'ON' : 'OFF'}
|
|
43
|
+
|
|
44
|
+
✦ *Commands:*
|
|
45
|
+
› on
|
|
46
|
+
› off
|
|
47
|
+
› pm
|
|
48
|
+
› group
|
|
49
|
+
› both
|
|
50
|
+
› pm on/off
|
|
51
|
+
› group on/off
|
|
52
|
+
› both on/off`;
|
|
53
|
+
await sock.sendMessage(chatId, { text: helpText }, { quoted: fake });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let newConfig = { ...config };
|
|
58
|
+
let responseText = '';
|
|
59
|
+
|
|
60
|
+
const toggle = parseToggleCommand(action);
|
|
61
|
+
|
|
62
|
+
if (toggle === 'on') {
|
|
63
|
+
newConfig.enabled = true;
|
|
64
|
+
newConfig.pm = true;
|
|
65
|
+
newConfig.group = true;
|
|
66
|
+
responseText = `✦ Autotyping ENABLED for both PMs & Groups`;
|
|
67
|
+
} else if (toggle === 'off') {
|
|
68
|
+
newConfig.enabled = false;
|
|
69
|
+
stopAllTypingIntervals();
|
|
70
|
+
responseText = `✦ Autotyping DISABLED`;
|
|
71
|
+
} else if (action === 'pm') {
|
|
72
|
+
const toggle2 = action2 ? parseToggleCommand(action2) : null;
|
|
73
|
+
if (toggle2 === 'off') {
|
|
74
|
+
newConfig.pm = false;
|
|
75
|
+
if (!newConfig.group) newConfig.enabled = false;
|
|
76
|
+
responseText = `✦ Autotyping PM mode DISABLED\n Group: ${newConfig.group ? 'ON' : 'OFF'}`;
|
|
77
|
+
} else {
|
|
78
|
+
newConfig.pm = true;
|
|
79
|
+
newConfig.group = false;
|
|
80
|
+
newConfig.enabled = true;
|
|
81
|
+
responseText = `✦ Autotyping enabled for PMs only`;
|
|
82
|
+
if (toggle2 === 'on') {
|
|
83
|
+
newConfig.group = config.group;
|
|
84
|
+
responseText = `✦ Autotyping PM mode ENABLED\n Group: ${newConfig.group ? 'ON' : 'OFF'}`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} else if (action === 'group') {
|
|
88
|
+
const toggle2 = action2 ? parseToggleCommand(action2) : null;
|
|
89
|
+
if (toggle2 === 'off') {
|
|
90
|
+
newConfig.group = false;
|
|
91
|
+
if (!newConfig.pm) newConfig.enabled = false;
|
|
92
|
+
responseText = `✦ Autotyping Group mode DISABLED\n PM: ${newConfig.pm ? 'ON' : 'OFF'}`;
|
|
93
|
+
} else {
|
|
94
|
+
newConfig.group = true;
|
|
95
|
+
newConfig.pm = false;
|
|
96
|
+
newConfig.enabled = true;
|
|
97
|
+
responseText = `✦ Autotyping enabled for Groups only`;
|
|
98
|
+
if (toggle2 === 'on') {
|
|
99
|
+
newConfig.pm = config.pm;
|
|
100
|
+
responseText = `✦ Autotyping Group mode ENABLED\n PM: ${newConfig.pm ? 'ON' : 'OFF'}`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
} else if (action === 'both') {
|
|
104
|
+
const toggle2 = action2 ? parseToggleCommand(action2) : null;
|
|
105
|
+
if (toggle2 === 'off') {
|
|
106
|
+
newConfig.enabled = false;
|
|
107
|
+
newConfig.pm = false;
|
|
108
|
+
newConfig.group = false;
|
|
109
|
+
stopAllTypingIntervals();
|
|
110
|
+
responseText = `✦ Autotyping DISABLED for both PMs & Groups`;
|
|
111
|
+
} else {
|
|
112
|
+
newConfig.pm = true;
|
|
113
|
+
newConfig.group = true;
|
|
114
|
+
newConfig.enabled = true;
|
|
115
|
+
responseText = `✦ Autotyping enabled for both PMs & Groups`;
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
responseText = `✦ Invalid! Use: on, off, pm, group, both\n Or: pm on/off, group on/off, both on/off`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (responseText && !responseText.includes('Invalid')) {
|
|
122
|
+
if (!newConfig.pm && !newConfig.group) {
|
|
123
|
+
newConfig.enabled = false;
|
|
124
|
+
stopAllTypingIntervals();
|
|
125
|
+
}
|
|
126
|
+
setOwnerConfig('autotyping', newConfig);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
await sock.sendMessage(chatId, { text: responseText }, { quoted: fake });
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error('Error in autotyping command:', error.message, 'Line:', error.stack?.split('\n')[1]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function isAutotypingEnabled() {
|
|
136
|
+
const config = getOwnerConfig('autotyping');
|
|
137
|
+
return config?.enabled || false;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function stopAllTypingIntervals() {
|
|
141
|
+
for (const [key, interval] of typingIntervals.entries()) {
|
|
142
|
+
clearInterval(interval);
|
|
143
|
+
typingIntervals.delete(key);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async function handleAutotypingForMessage(sock, chatId) {
|
|
148
|
+
try {
|
|
149
|
+
const config = getOwnerConfig('autotyping');
|
|
150
|
+
if (!config?.enabled) return;
|
|
151
|
+
|
|
152
|
+
const isGroup = chatId.endsWith('@g.us');
|
|
153
|
+
if (isGroup && !config.group) return;
|
|
154
|
+
if (!isGroup && !config.pm) return;
|
|
155
|
+
|
|
156
|
+
if (typingIntervals.has(chatId)) {
|
|
157
|
+
clearInterval(typingIntervals.get(chatId));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
await sock.presenceSubscribe(chatId);
|
|
161
|
+
await sock.sendPresenceUpdate('composing', chatId);
|
|
162
|
+
|
|
163
|
+
const interval = setInterval(async () => {
|
|
164
|
+
try {
|
|
165
|
+
const currentConfig = getOwnerConfig('autotyping');
|
|
166
|
+
if (!currentConfig?.enabled) {
|
|
167
|
+
clearInterval(interval);
|
|
168
|
+
typingIntervals.delete(chatId);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
await sock.sendPresenceUpdate('composing', chatId);
|
|
172
|
+
} catch (e) {
|
|
173
|
+
clearInterval(interval);
|
|
174
|
+
typingIntervals.delete(chatId);
|
|
175
|
+
}
|
|
176
|
+
}, 4000);
|
|
177
|
+
|
|
178
|
+
typingIntervals.set(chatId, interval);
|
|
179
|
+
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
if (typingIntervals.has(chatId)) {
|
|
182
|
+
clearInterval(typingIntervals.get(chatId));
|
|
183
|
+
typingIntervals.delete(chatId);
|
|
184
|
+
try { sock.sendPresenceUpdate('paused', chatId); } catch(e) {}
|
|
185
|
+
}
|
|
186
|
+
}, 30000);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
console.error('Autotyping error:', error.message);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
module.exports = {
|
|
193
|
+
autotypingCommand,
|
|
194
|
+
isAutotypingEnabled,
|
|
195
|
+
handleAutotypingForMessage,
|
|
196
|
+
stopAllTypingIntervals
|
|
197
|
+
};
|