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,50 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
const axios = require('axios');
|
|
3
|
+
|
|
4
|
+
async function davexCommand(sock, chatId, message, args) {
|
|
5
|
+
const fake = createFakeContact(message);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
const query = args.join(' ').trim();
|
|
8
|
+
|
|
9
|
+
if (!query) {
|
|
10
|
+
return sock.sendMessage(chatId, {
|
|
11
|
+
text: `⦠${botName} AI\n\nUse: .davex <question>\nExample: .davex what is AI`
|
|
12
|
+
}, { quoted: fake });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
await sock.sendMessage(chatId, { react: { text: 'ā”', key: message.key } });
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const apis = [
|
|
19
|
+
{ url: `https://bk9.fun/ai/gemini?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
20
|
+
{ url: `https://iamtkm.vercel.app/ai/gpt5?apikey=tkm&text=${encodeURIComponent(query)}`, parse: d => d.result },
|
|
21
|
+
{ url: `https://apis.xwolf.space/api/ai/gemini`, method: 'POST', body: { prompt: query }, parse: d => d.result || d.response }
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
for (const api of apis) {
|
|
25
|
+
try {
|
|
26
|
+
let res;
|
|
27
|
+
if (api.method === 'POST') {
|
|
28
|
+
res = await axios.post(api.url, api.body, { timeout: 15000 });
|
|
29
|
+
} else {
|
|
30
|
+
res = await axios.get(api.url, { timeout: 15000 });
|
|
31
|
+
}
|
|
32
|
+
const result = api.parse(res.data);
|
|
33
|
+
if (result && result.trim()) {
|
|
34
|
+
await sock.sendMessage(chatId, { text: result.substring(0, 2000) }, { quoted: fake });
|
|
35
|
+
await sock.sendMessage(chatId, { react: { text: 'ā
', key: message.key } });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
} catch {}
|
|
39
|
+
}
|
|
40
|
+
await sock.sendMessage(chatId, {
|
|
41
|
+
text: `⦠All AI services down. Try later.`
|
|
42
|
+
}, { quoted: fake });
|
|
43
|
+
} catch (err) {
|
|
44
|
+
await sock.sendMessage(chatId, {
|
|
45
|
+
text: `⦠Error: ${err.message}`
|
|
46
|
+
}, { quoted: fake });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = davexCommand;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
async function deepseekCommand(sock, chatId, message) {
|
|
5
|
+
const fake = createFakeContact(message);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
// Send 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}* DeepSeek AI\n\nUse: .deepseek <question>\nExample: .deepseek 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 DeepSeek API
|
|
44
|
+
const apiUrl = `https://meta-api.zone.id/ai/copilot?message=${encodeURIComponent(query)}`;
|
|
45
|
+
const response = await axios.get(apiUrl, { timeout: 30000 });
|
|
46
|
+
const apiData = response.data;
|
|
47
|
+
|
|
48
|
+
if (!apiData.responseTime || !apiData.answer) {
|
|
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.answer.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
|
+
} catch (error) {
|
|
69
|
+
console.error("DeepSeek command error:", error);
|
|
70
|
+
|
|
71
|
+
// Send error reaction
|
|
72
|
+
await sock.sendMessage(chatId, {
|
|
73
|
+
react: { text: 'ā', key: message.key }
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
let errorMessage = "⦠Failed to generate response";
|
|
77
|
+
|
|
78
|
+
if (error.response?.status === 404) {
|
|
79
|
+
errorMessage = '⦠Service unavailable';
|
|
80
|
+
} else if (error.message.includes('timeout') || error.code === 'ECONNABORTED') {
|
|
81
|
+
errorMessage = '⦠Request timeout';
|
|
82
|
+
} else if (error.code === 'ENOTFOUND') {
|
|
83
|
+
errorMessage = '⦠Network error';
|
|
84
|
+
} else if (error.response?.status === 429) {
|
|
85
|
+
errorMessage = '⦠Too many requests';
|
|
86
|
+
} else if (error.response?.status >= 500) {
|
|
87
|
+
errorMessage = '⦠Server error';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
await sock.sendMessage(chatId, {
|
|
91
|
+
text: errorMessage
|
|
92
|
+
}, { quoted: fake });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
module.exports = deepseekCommand;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
|
|
3
|
+
async function grokCommand(sock, chatId, message) {
|
|
4
|
+
try {
|
|
5
|
+
const text = message.message?.conversation ||
|
|
6
|
+
message.message?.extendedTextMessage?.text ||
|
|
7
|
+
message.text;
|
|
8
|
+
|
|
9
|
+
if (!text) {
|
|
10
|
+
return sendMsg(sock, chatId, message, "Please provide a question after !grok\n\nExample: !grok What is quantum computing?");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const [command, ...rest] = text.split(' ');
|
|
14
|
+
const query = rest.join(' ').trim();
|
|
15
|
+
|
|
16
|
+
if (!query) {
|
|
17
|
+
return sendMsg(sock, chatId, message, "ā Please provide a query.\nExample: !grok What is quantum computing?");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
await sock.sendMessage(chatId, { react: { text: 'š¤', key: message.key } });
|
|
21
|
+
await handleGrok(sock, chatId, message, query);
|
|
22
|
+
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error('Grok Command Error:', err);
|
|
25
|
+
await sendMsg(sock, chatId, message, "ā An error occurred. Please try again later.");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function handleGrok(sock, chatId, message, query) {
|
|
30
|
+
try {
|
|
31
|
+
const url = `https://apiskeith.vercel.app/ai/grok?q=${encodeURIComponent(query)}`;
|
|
32
|
+
|
|
33
|
+
const { data } = await axios.get(url, {
|
|
34
|
+
headers: {
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
},
|
|
37
|
+
timeout: 30000 // 30 second timeout
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (data?.status) {
|
|
41
|
+
await sendMsg(sock, chatId, message, data.result);
|
|
42
|
+
} else {
|
|
43
|
+
await sendMsg(sock, chatId, message, "ā API returned an error.");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.error('Grok API Error:', err);
|
|
48
|
+
|
|
49
|
+
let errorMessage = "ā ļø Failed to get response from Grok AI.";
|
|
50
|
+
|
|
51
|
+
if (err.code === 'ECONNABORTED') {
|
|
52
|
+
errorMessage = "ā Request timeout. Please try again.";
|
|
53
|
+
} else if (err.response?.status === 429) {
|
|
54
|
+
errorMessage = "ā Rate limit exceeded. Please try again later.";
|
|
55
|
+
} else if (err.response?.status) {
|
|
56
|
+
errorMessage = `ā API Error (Status: ${err.response.status}).`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
await sendMsg(sock, chatId, message, errorMessage);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function sendMsg(sock, chatId, message, text) {
|
|
64
|
+
return sock.sendMessage(chatId, { text }, { quoted: message });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
module.exports = grokCommand;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { fetchBuffer } = require('../../davelib/myfunc');
|
|
3
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
4
|
+
|
|
5
|
+
// Fake contact creator š
|
|
6
|
+
async function imagineCommand(sock, chatId, message) {
|
|
7
|
+
try {
|
|
8
|
+
// Get the prompt from the message
|
|
9
|
+
const prompt = message.message?.conversation?.trim() ||
|
|
10
|
+
message.message?.extendedTextMessage?.text?.trim() || '';
|
|
11
|
+
|
|
12
|
+
// Remove the command prefix and trim
|
|
13
|
+
const imagePrompt = prompt.slice(8).trim();
|
|
14
|
+
|
|
15
|
+
const fkontak = createFakeContact(message);
|
|
16
|
+
|
|
17
|
+
if (!imagePrompt) {
|
|
18
|
+
await sock.sendMessage(chatId, {
|
|
19
|
+
text: 'Please provide a prompt for the image to be generated.\nExample: .imagine Dave kissing my girlfriend'
|
|
20
|
+
}, {
|
|
21
|
+
quoted: fkontak
|
|
22
|
+
});
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Send processing message
|
|
27
|
+
await sock.sendMessage(chatId, {
|
|
28
|
+
text: 'Creating your masterpiece...'
|
|
29
|
+
}, {
|
|
30
|
+
quoted: fkontak
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Enhance the prompt with quality keywords
|
|
34
|
+
const enhancedPrompt = enhancePrompt(imagePrompt);
|
|
35
|
+
|
|
36
|
+
// Make API request
|
|
37
|
+
const response = await axios.get(`https://shizoapi.onrender.com/api/ai/imagine?apikey=shizo&query=${encodeURIComponent(enhancedPrompt)}`, {
|
|
38
|
+
responseType: 'arraybuffer'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Convert response to buffer
|
|
42
|
+
const imageBuffer = Buffer.from(response.data);
|
|
43
|
+
|
|
44
|
+
// Send the generated image
|
|
45
|
+
await sock.sendMessage(chatId, {
|
|
46
|
+
image: imageBuffer,
|
|
47
|
+
caption: `Generated image for prompt: "${imagePrompt}"`
|
|
48
|
+
}, {
|
|
49
|
+
quoted: fkontak
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error('Error in imagine command:', error);
|
|
54
|
+
const fkontak = createFakeContact(message);
|
|
55
|
+
await sock.sendMessage(chatId, {
|
|
56
|
+
text: 'Failed to generate image. Please try again.'
|
|
57
|
+
}, {
|
|
58
|
+
quoted: fkontak
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Function to enhance the prompt
|
|
64
|
+
function enhancePrompt(prompt) {
|
|
65
|
+
// Quality enhancing keywords
|
|
66
|
+
const qualityEnhancers = [
|
|
67
|
+
'high quality',
|
|
68
|
+
'detailed',
|
|
69
|
+
'masterpiece',
|
|
70
|
+
'best quality',
|
|
71
|
+
'ultra realistic',
|
|
72
|
+
'4k',
|
|
73
|
+
'highly detailed',
|
|
74
|
+
'professional photography',
|
|
75
|
+
'cinematic lighting',
|
|
76
|
+
'sharp focus'
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// Randomly select 3-4 enhancers
|
|
80
|
+
const numEnhancers = Math.floor(Math.random() * 2) + 3; // Random number between 3-4
|
|
81
|
+
const selectedEnhancers = qualityEnhancers
|
|
82
|
+
.sort(() => Math.random() - 0.5)
|
|
83
|
+
.slice(0, numEnhancers);
|
|
84
|
+
|
|
85
|
+
// Combine original prompt with enhancers
|
|
86
|
+
return `${prompt}, ${selectedEnhancers.join(', ')}`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
module.exports = imagineCommand;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
async function metaaiCommand(sock, chatId, message) {
|
|
5
|
+
const fake = createFakeContact(message);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
// Send reaction
|
|
10
|
+
await sock.sendMessage(chatId, {
|
|
11
|
+
react: { text: 'ā³', key: message.key }
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const text = message.message?.conversation || message.message?.extendedTextMessage?.text;
|
|
15
|
+
const parts = text.split(' ');
|
|
16
|
+
const query = parts.slice(1).join(' ').trim();
|
|
17
|
+
|
|
18
|
+
if (!query) {
|
|
19
|
+
return await sock.sendMessage(chatId, {
|
|
20
|
+
text: `⦠*${botName}* Meta AI\n\nUse: .metaai <question>\nExample: .metaai what is AI`
|
|
21
|
+
}, { quoted: fake });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (query.length > 1000) {
|
|
25
|
+
return await sock.sendMessage(chatId, {
|
|
26
|
+
text: `⦠*${botName}*\nQuestion too long (max 1000 chars)`
|
|
27
|
+
}, { quoted: fake });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Update presence to "typing"
|
|
31
|
+
await sock.sendPresenceUpdate('composing', chatId);
|
|
32
|
+
|
|
33
|
+
// Fetch AI response
|
|
34
|
+
const apiUrl = `https://apis.davidcyriltech.my.id/ai/metaai?text=${encodeURIComponent(query)}`;
|
|
35
|
+
const response = await axios.get(apiUrl, { timeout: 30000 });
|
|
36
|
+
const apiData = response.data;
|
|
37
|
+
|
|
38
|
+
if (!apiData.success || !apiData.response) {
|
|
39
|
+
throw new Error("API failed to generate response!");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Send success reaction
|
|
43
|
+
await sock.sendMessage(chatId, {
|
|
44
|
+
react: { text: 'ā
', key: message.key }
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Format and send response
|
|
48
|
+
const aiResponse = apiData.response.trim();
|
|
49
|
+
|
|
50
|
+
await sock.sendMessage(chatId, {
|
|
51
|
+
text: `⦠*${botName}* - am know invisible š„
|
|
52
|
+
|
|
53
|
+
⦠Question: ${query}
|
|
54
|
+
|
|
55
|
+
⦠${aiResponse}`
|
|
56
|
+
}, { quoted: fake });
|
|
57
|
+
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error("Meta AI command error:", error);
|
|
60
|
+
|
|
61
|
+
// Send error reaction
|
|
62
|
+
await sock.sendMessage(chatId, {
|
|
63
|
+
react: { text: 'ā', key: message.key }
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
let errorMessage = "⦠Failed to generate response";
|
|
67
|
+
|
|
68
|
+
if (error.response?.status === 404) {
|
|
69
|
+
errorMessage = '⦠Service unavailable';
|
|
70
|
+
} else if (error.message.includes('timeout') || error.code === 'ECONNABORTED') {
|
|
71
|
+
errorMessage = '⦠Request timeout';
|
|
72
|
+
} else if (error.code === 'ENOTFOUND') {
|
|
73
|
+
errorMessage = '⦠Network error';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
await sock.sendMessage(chatId, {
|
|
77
|
+
text: errorMessage
|
|
78
|
+
}, { quoted: fake });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = metaaiCommand;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
async function mistralCommand(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}* Mistral AI\n\nUse: .mistral <question>\nExample: .mistral 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 Mistral API
|
|
44
|
+
const apiUrl = `https://apiskeith.top/ai/mistral?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("Mistral 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 = mistralCommand;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
async function perplexityCommand(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}* Perplexity AI\n\nUse: .perplexity <question>\nExample: .perplexity 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 Perplexity API
|
|
44
|
+
const apiUrl = `https://apiskeith.top/ai/perplexity?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("Perplexity AI failed to generate response!");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Send success reaction
|
|
53
|
+
await sock.sendMessage(chatId, {
|
|
54
|
+
react: { text: 'ā
', key: message.key }
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Send clean response with signature
|
|
58
|
+
const aiResponse = apiData.result.trim();
|
|
59
|
+
await sock.sendMessage(chatId, {
|
|
60
|
+
text: `⦠*${botName}* - am know invisible š„\n\n${aiResponse}`
|
|
61
|
+
}, { quoted: fake });
|
|
62
|
+
|
|
63
|
+
// Final reaction
|
|
64
|
+
await sock.sendMessage(chatId, {
|
|
65
|
+
react: { text: 'š', key: message.key }
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error("Perplexity AI command error:", error);
|
|
70
|
+
|
|
71
|
+
await sock.sendMessage(chatId, {
|
|
72
|
+
react: { text: 'ā', key: message.key }
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
let errorMessage = "⦠Failed to generate response";
|
|
76
|
+
|
|
77
|
+
if (error.response?.status === 404) {
|
|
78
|
+
errorMessage = '⦠Service unavailable';
|
|
79
|
+
} else if (error.message.includes('timeout') || error.code === 'ECONNABORTED') {
|
|
80
|
+
errorMessage = '⦠Request timeout';
|
|
81
|
+
} else if (error.code === 'ENOTFOUND') {
|
|
82
|
+
errorMessage = '⦠Network error';
|
|
83
|
+
} else if (error.response?.status === 429) {
|
|
84
|
+
errorMessage = '⦠Too many requests';
|
|
85
|
+
} else if (error.response?.status >= 500) {
|
|
86
|
+
errorMessage = '⦠Server error';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
await sock.sendMessage(chatId, {
|
|
90
|
+
text: errorMessage
|
|
91
|
+
}, { quoted: fake });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
module.exports = perplexityCommand;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
async function soraCommand(sock, chatId, message) {
|
|
4
|
+
const fkontak = createFakeContact(message);
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const rawText = message.message?.conversation?.trim() ||
|
|
8
|
+
message.message?.extendedTextMessage?.text?.trim() ||
|
|
9
|
+
message.message?.imageMessage?.caption?.trim() ||
|
|
10
|
+
message.message?.videoMessage?.caption?.trim() ||
|
|
11
|
+
'';
|
|
12
|
+
|
|
13
|
+
const used = (rawText || '').split(/\s+/)[0] || '.sora';
|
|
14
|
+
const args = rawText.slice(used.length).trim();
|
|
15
|
+
const quoted = message.message?.extendedTextMessage?.contextInfo?.quotedMessage;
|
|
16
|
+
const quotedText = quoted?.conversation || quoted?.extendedTextMessage?.text || '';
|
|
17
|
+
const input = args || quotedText;
|
|
18
|
+
|
|
19
|
+
if (!input) {
|
|
20
|
+
await sock.sendMessage(chatId, { text: 'Provide a prompt. Example: .sora anime girl with short blue hair' }, { quoted: fkontak });
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const apiUrl = `https://okatsu-rolezapiiz.vercel.app/ai/txt2video?text=${encodeURIComponent(input)}`;
|
|
25
|
+
const { data } = await axios.get(apiUrl, { timeout: 60000, headers: { 'user-agent': 'Mozilla/5.0' } });
|
|
26
|
+
|
|
27
|
+
const videoUrl = data?.videoUrl || data?.result || data?.data?.videoUrl;
|
|
28
|
+
if (!videoUrl) {
|
|
29
|
+
throw new Error('No videoUrl in API response');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
await sock.sendMessage(chatId, {
|
|
33
|
+
video: { url: videoUrl },
|
|
34
|
+
mimetype: 'video/mp4',
|
|
35
|
+
caption: `Prompt: ${input}`
|
|
36
|
+
}, { quoted: fkontak });
|
|
37
|
+
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error('Sora error:', error?.message || error);
|
|
40
|
+
await sock.sendMessage(chatId, { text: 'Failed to generate video.' }, { quoted: fkontak });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
module.exports = soraCommand;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
async function speechwriterCommand(sock, chatId, message, args) {
|
|
5
|
+
const fake = createFakeContact(message);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
await sock.sendMessage(chatId, { react: { text: 'ā³', key: message.key } });
|
|
10
|
+
|
|
11
|
+
const text = message.message?.conversation ||
|
|
12
|
+
message.message?.extendedTextMessage?.text ||
|
|
13
|
+
message.message?.imageMessage?.caption || '';
|
|
14
|
+
|
|
15
|
+
const query = text.split(' ').slice(1).join(' ').trim();
|
|
16
|
+
|
|
17
|
+
if (!query) {
|
|
18
|
+
return await sock.sendMessage(chatId, {
|
|
19
|
+
text: `⦠*${botName}* | Speechwriter\n\nUse: .speechwriter <topic>\nExample: .speechwriter motivational speech about teamwork`
|
|
20
|
+
}, { quoted: fake });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
await sock.sendPresenceUpdate('composing', chatId);
|
|
24
|
+
|
|
25
|
+
const prompt = `Write a compelling, well-structured speech about: ${query}. Include an introduction, main points, and a strong conclusion.`;
|
|
26
|
+
const apiUrl = `https://api.siputzx.my.id/api/ai/meta-llama?content=${encodeURIComponent(prompt)}`;
|
|
27
|
+
const response = await axios.get(apiUrl, { timeout: 30000 });
|
|
28
|
+
|
|
29
|
+
const result = response.data?.data || response.data?.result || response.data;
|
|
30
|
+
if (!result || typeof result !== 'string') throw new Error('No response from API');
|
|
31
|
+
|
|
32
|
+
await sock.sendMessage(chatId, { react: { text: 'ā
', key: message.key } });
|
|
33
|
+
await sock.sendMessage(chatId, {
|
|
34
|
+
text: `⦠*${botName}* | Speechwriter\n\nš *Topic:* ${query}\n\n${result.trim()}`
|
|
35
|
+
}, { quoted: fake });
|
|
36
|
+
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error('Speechwriter error:', error.message);
|
|
39
|
+
await sock.sendMessage(chatId, { react: { text: 'ā', key: message.key } });
|
|
40
|
+
await sock.sendMessage(chatId, {
|
|
41
|
+
text: `⦠*${botName}* | Failed to generate speech. Please try again.`
|
|
42
|
+
}, { quoted: fake });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = speechwriterCommand;
|