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,121 @@
|
|
|
1
|
+
class WordChainGame {
|
|
2
|
+
constructor(hostId) {
|
|
3
|
+
this.host = hostId;
|
|
4
|
+
this.players = [hostId];
|
|
5
|
+
this.scores = {};
|
|
6
|
+
this.scores[hostId] = 0;
|
|
7
|
+
this.usedWords = new Set();
|
|
8
|
+
this.currentPlayerIndex = 0;
|
|
9
|
+
this.lastWord = null;
|
|
10
|
+
this.state = 'WAITING';
|
|
11
|
+
this.rounds = 0;
|
|
12
|
+
this.maxInactivity = 60000;
|
|
13
|
+
this.createdAt = Date.now();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
addPlayer(playerId) {
|
|
17
|
+
if (this.players.includes(playerId)) return false;
|
|
18
|
+
if (this.state !== 'WAITING') return false;
|
|
19
|
+
this.players.push(playerId);
|
|
20
|
+
this.scores[playerId] = 0;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
start() {
|
|
25
|
+
if (this.players.length < 2) return false;
|
|
26
|
+
this.state = 'PLAYING';
|
|
27
|
+
this.currentPlayerIndex = 0;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get currentPlayer() {
|
|
32
|
+
return this.players[this.currentPlayerIndex];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
submitWord(playerId, word) {
|
|
36
|
+
if (this.state !== 'PLAYING') return { ok: false, reason: 'Game not active' };
|
|
37
|
+
if (playerId !== this.currentPlayer) return { ok: false, reason: 'Not your turn' };
|
|
38
|
+
|
|
39
|
+
word = word.toLowerCase().trim();
|
|
40
|
+
|
|
41
|
+
if (word.length < 2) return { ok: false, reason: 'Word must be at least 2 letters' };
|
|
42
|
+
if (this.usedWords.has(word)) return { ok: false, reason: 'Word already used!' };
|
|
43
|
+
if (this.lastWord) {
|
|
44
|
+
const lastChar = this.lastWord.charAt(this.lastWord.length - 1);
|
|
45
|
+
if (word.charAt(0) !== lastChar) {
|
|
46
|
+
return { ok: false, reason: `Word must start with "${lastChar.toUpperCase()}"` };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
this.usedWords.add(word);
|
|
51
|
+
this.lastWord = word;
|
|
52
|
+
this.scores[playerId] = (this.scores[playerId] || 0) + word.length;
|
|
53
|
+
this.rounds++;
|
|
54
|
+
this.currentPlayerIndex = (this.currentPlayerIndex + 1) % this.players.length;
|
|
55
|
+
|
|
56
|
+
return { ok: true, nextPlayer: this.currentPlayer, word };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
eliminateCurrentPlayer() {
|
|
60
|
+
const eliminated = this.players.splice(this.currentPlayerIndex, 1)[0];
|
|
61
|
+
if (this.currentPlayerIndex >= this.players.length) {
|
|
62
|
+
this.currentPlayerIndex = 0;
|
|
63
|
+
}
|
|
64
|
+
if (this.players.length <= 1) {
|
|
65
|
+
this.state = 'ENDED';
|
|
66
|
+
}
|
|
67
|
+
return eliminated;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
getScoreboard() {
|
|
71
|
+
return Object.entries(this.scores)
|
|
72
|
+
.sort((a, b) => b[1] - a[1])
|
|
73
|
+
.map(([player, score], i) => `${i + 1}. @${player.split(':')[0].split('@')[0]}: ${score} pts`)
|
|
74
|
+
.join('\n');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get winner() {
|
|
78
|
+
if (this.players.length === 1) return this.players[0];
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static findAIWord(lastChar, usedWords) {
|
|
83
|
+
const commonWords = {
|
|
84
|
+
'a': ['apple', 'arrow', 'angel', 'animal', 'anchor', 'album', 'atom', 'acid', 'azure'],
|
|
85
|
+
'b': ['banana', 'bridge', 'bottle', 'butter', 'brain', 'beach', 'blood', 'brave'],
|
|
86
|
+
'c': ['cat', 'castle', 'crown', 'chain', 'cloud', 'coral', 'cream', 'click'],
|
|
87
|
+
'd': ['dog', 'dream', 'dance', 'door', 'drum', 'dusk', 'drift', 'delta'],
|
|
88
|
+
'e': ['eagle', 'earth', 'energy', 'extra', 'echo', 'ember', 'eleven', 'event'],
|
|
89
|
+
'f': ['fish', 'flame', 'forest', 'friend', 'frost', 'flash', 'fruit', 'field'],
|
|
90
|
+
'g': ['grape', 'garden', 'ghost', 'green', 'glass', 'globe', 'grain', 'gear'],
|
|
91
|
+
'h': ['house', 'heart', 'honey', 'horse', 'hello', 'hunter', 'hammer', 'haze'],
|
|
92
|
+
'i': ['island', 'iron', 'ivory', 'igloo', 'image', 'input', 'index', 'ice'],
|
|
93
|
+
'j': ['jungle', 'jewel', 'juice', 'jacket', 'jazz', 'jolly', 'junior', 'jest'],
|
|
94
|
+
'k': ['king', 'knife', 'knight', 'kite', 'kernel', 'karma', 'knot', 'keen'],
|
|
95
|
+
'l': ['lion', 'light', 'lemon', 'lake', 'lunar', 'lotus', 'letter', 'lime'],
|
|
96
|
+
'm': ['moon', 'magic', 'music', 'mouse', 'maple', 'mirror', 'metal', 'mint'],
|
|
97
|
+
'n': ['night', 'nature', 'noble', 'north', 'nest', 'needle', 'nerve', 'note'],
|
|
98
|
+
'o': ['ocean', 'orange', 'orbit', 'olive', 'onion', 'opera', 'opal', 'oven'],
|
|
99
|
+
'p': ['planet', 'pearl', 'piano', 'python', 'price', 'plant', 'power', 'pulse'],
|
|
100
|
+
'q': ['queen', 'quest', 'quiet', 'quilt', 'quartz', 'quick', 'quote', 'quiz'],
|
|
101
|
+
'r': ['river', 'rainbow', 'rocket', 'rose', 'rain', 'robot', 'ridge', 'rust'],
|
|
102
|
+
's': ['star', 'stone', 'snake', 'storm', 'sugar', 'silver', 'sand', 'sword'],
|
|
103
|
+
't': ['tiger', 'tower', 'train', 'tree', 'table', 'torch', 'tulip', 'trail'],
|
|
104
|
+
'u': ['umbrella', 'unicorn', 'ultra', 'unity', 'urban', 'upper', 'usual', 'under'],
|
|
105
|
+
'v': ['violet', 'voice', 'valley', 'venom', 'verse', 'vault', 'vivid', 'vine'],
|
|
106
|
+
'w': ['water', 'world', 'winter', 'whale', 'wind', 'wizard', 'wolf', 'wave'],
|
|
107
|
+
'x': ['xenon', 'xerox', 'xylophone'],
|
|
108
|
+
'y': ['yellow', 'yacht', 'yarn', 'youth', 'yield', 'yonder'],
|
|
109
|
+
'z': ['zebra', 'zero', 'zone', 'zenith', 'zodiac', 'zephyr', 'zinc'],
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const words = commonWords[lastChar] || [];
|
|
113
|
+
const available = words.filter(w => !usedWords.has(w));
|
|
114
|
+
if (available.length > 0) {
|
|
115
|
+
return available[Math.floor(Math.random() * available.length)];
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
module.exports = WordChainGame;
|
package/daveset.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const settings = {
|
|
2
|
+
packname: '',
|
|
3
|
+
author: 'Davex Tech',
|
|
4
|
+
botName: "DAVE-X",
|
|
5
|
+
botOwner: 'Dave',
|
|
6
|
+
ownerNumber: '254104260236',
|
|
7
|
+
giphyApiKey: 'qnl7ssQChTdPjsKta2Ax2LMaGXz303tq',
|
|
8
|
+
commandMode: "public",
|
|
9
|
+
maxStoreMessages: 5,
|
|
10
|
+
storeWriteInterval: 60000,
|
|
11
|
+
description: "DAVE-X - Advanced WhatsApp Bot",
|
|
12
|
+
version: "4.0.0",
|
|
13
|
+
updateZipUrl: "https://github.com/Davex-254/DAVE-X/archive/refs/heads/main.zip",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
module.exports = settings;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
const GPT_API = {
|
|
5
|
+
baseURL: "https://iamtkm.vercel.app",
|
|
6
|
+
endpoint: "/ai/gpt5",
|
|
7
|
+
apiKey: "tkm"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
async function aiCommand(sock, chatId, message) {
|
|
11
|
+
try {
|
|
12
|
+
const fake = createFakeContact(message);
|
|
13
|
+
const botName = getBotName();
|
|
14
|
+
const text = message.message?.conversation ||
|
|
15
|
+
message.message?.extendedTextMessage?.text;
|
|
16
|
+
|
|
17
|
+
if (!text) {
|
|
18
|
+
return await sock.sendMessage(chatId, {
|
|
19
|
+
text: `✦ AI Assistant\n\nUse: .ai [your question]\nExample: .ai explain machine learning`
|
|
20
|
+
}, { quoted: fake });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const parts = text.split(' ');
|
|
24
|
+
const query = parts.slice(1).join(' ').trim();
|
|
25
|
+
|
|
26
|
+
if (!query) {
|
|
27
|
+
return await sock.sendMessage(chatId, {
|
|
28
|
+
text: `✦ Need a question after .ai\n\nExample: .ai what is AI`
|
|
29
|
+
}, { quoted: fake });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
await sock.sendMessage(chatId, {
|
|
33
|
+
react: { text: '⚡', key: message.key }
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
await processAIRequest(sock, chatId, message, query);
|
|
37
|
+
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error('AI Command Error:', error);
|
|
40
|
+
const fake = createFakeContact(message);
|
|
41
|
+
await sock.sendMessage(chatId, {
|
|
42
|
+
text: `✦ AI service down. Try again later.`
|
|
43
|
+
}, { quoted: fake });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function processAIRequest(sock, chatId, message, query) {
|
|
48
|
+
try {
|
|
49
|
+
const fake = createFakeContact(message);
|
|
50
|
+
const apiUrl = `${GPT_API.baseURL}${GPT_API.endpoint}?apikey=${GPT_API.apiKey}&text=${encodeURIComponent(query)}`;
|
|
51
|
+
|
|
52
|
+
const response = await axios.get(apiUrl, {
|
|
53
|
+
timeout: 30000,
|
|
54
|
+
headers: {
|
|
55
|
+
'User-Agent': 'WhatsApp-Bot/1.0',
|
|
56
|
+
'Accept': 'application/json'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const data = response.data;
|
|
61
|
+
|
|
62
|
+
if (data.status && data.statusCode === 200 && data.result) {
|
|
63
|
+
await sock.sendMessage(chatId, {
|
|
64
|
+
text: data.result
|
|
65
|
+
}, { quoted: fake });
|
|
66
|
+
|
|
67
|
+
await sock.sendMessage(chatId, {
|
|
68
|
+
react: { text: '✅', key: message.key }
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
await sock.sendMessage(chatId, {
|
|
72
|
+
text: `✦ AI couldn't generate a response. Try a different question.`
|
|
73
|
+
}, { quoted: fake });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error('AI API Error:', error.message);
|
|
78
|
+
const fake = createFakeContact(message);
|
|
79
|
+
|
|
80
|
+
if (error.response?.status === 429) {
|
|
81
|
+
await sock.sendMessage(chatId, {
|
|
82
|
+
text: `✦ Rate limit. Wait 5 minutes.`
|
|
83
|
+
}, { quoted: fake });
|
|
84
|
+
} else if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') {
|
|
85
|
+
await sock.sendMessage(chatId, {
|
|
86
|
+
text: `✦ Request timeout. Try shorter question.`
|
|
87
|
+
}, { quoted: fake });
|
|
88
|
+
} else {
|
|
89
|
+
await sock.sendMessage(chatId, {
|
|
90
|
+
text: `✦ AI service error. Try later.`
|
|
91
|
+
}, { quoted: fake });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
await sock.sendMessage(chatId, {
|
|
95
|
+
react: { text: '❌', key: message.key }
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
module.exports = aiCommand;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
async function gpt4Command(sock, chatId, message) {
|
|
5
|
+
const botName = getBotName();
|
|
6
|
+
try {
|
|
7
|
+
const text = message.message?.conversation ||
|
|
8
|
+
message.message?.extendedTextMessage?.text ||
|
|
9
|
+
message.text;
|
|
10
|
+
|
|
11
|
+
if (!text) {
|
|
12
|
+
const fake = createFakeContact(message);
|
|
13
|
+
return sock.sendMessage(chatId, { text: `*${botName}*\nType your question after the command\nExample: .ai explain quantum physics` }, { quoted: fake });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const [command, ...rest] = text.split(' ');
|
|
17
|
+
const query = rest.join(' ').trim();
|
|
18
|
+
|
|
19
|
+
if (!query) {
|
|
20
|
+
const fake = createFakeContact(message);
|
|
21
|
+
return sock.sendMessage(chatId, { text: `*${botName}*\nMissing question\nExample: .ai what is AI?` }, { quoted: fake });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
await sock.sendMessage(chatId, { react: { text: '>', key: message.key } });
|
|
25
|
+
await handleAI(sock, chatId, message, query);
|
|
26
|
+
|
|
27
|
+
} catch (err) {
|
|
28
|
+
console.error('AI Command Error:', err);
|
|
29
|
+
const fake = createFakeContact(message);
|
|
30
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAI service error` }, { quoted: fake });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function handleAI(sock, chatId, message, query) {
|
|
35
|
+
const botName = getBotName();
|
|
36
|
+
const fake = createFakeContact(message);
|
|
37
|
+
|
|
38
|
+
const apis = [
|
|
39
|
+
{ url: `https://bk9.fun/ai/GPT4o?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
40
|
+
{ url: `https://api.dreaded.site/api/chatgpt?text=${encodeURIComponent(query)}`, parse: d => d.result },
|
|
41
|
+
{ url: `https://iamtkm.vercel.app/ai/gpt5?apikey=tkm&text=${encodeURIComponent(query)}`, parse: d => d.result },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
for (const api of apis) {
|
|
45
|
+
try {
|
|
46
|
+
const res = await axios.get(api.url, { timeout: 15000 });
|
|
47
|
+
const result = api.parse(res.data);
|
|
48
|
+
if (result && result.trim()) {
|
|
49
|
+
await sock.sendMessage(chatId, { text: result.substring(0, 3000) }, { quoted: fake });
|
|
50
|
+
await sock.sendMessage(chatId, { react: { text: '>', key: message.key } });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
} catch {}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nAI services are currently down. Try again later.` }, { quoted: fake });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = gpt4Command;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
3
|
+
|
|
4
|
+
// Helper function to try multiple APIs
|
|
5
|
+
async function tryAPIs(apis) {
|
|
6
|
+
for (const api of apis) {
|
|
7
|
+
try {
|
|
8
|
+
let res;
|
|
9
|
+
if (api.method === 'POST') {
|
|
10
|
+
res = await axios.post(api.url, api.body, {
|
|
11
|
+
timeout: 15000,
|
|
12
|
+
headers: api.headers || {}
|
|
13
|
+
});
|
|
14
|
+
} else {
|
|
15
|
+
res = await axios.get(api.url, {
|
|
16
|
+
timeout: 15000,
|
|
17
|
+
headers: api.headers || {}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Handle different response formats
|
|
22
|
+
const result = api.parse(res.data);
|
|
23
|
+
if (result && typeof result === 'string' && result.trim().length > 0) {
|
|
24
|
+
return result.substring(0, 3000);
|
|
25
|
+
}
|
|
26
|
+
} catch (e) {
|
|
27
|
+
// Silently fail and try next API
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ==================== DEEPSEEK (FIXED - WORKING) ====================
|
|
34
|
+
async function deepseekCommand(sock, chatId, message, args) {
|
|
35
|
+
const fake = createFakeContact(message);
|
|
36
|
+
const botName = getBotName();
|
|
37
|
+
const query = args.join(' ').trim();
|
|
38
|
+
|
|
39
|
+
if (!query) {
|
|
40
|
+
return sock.sendMessage(chatId, {
|
|
41
|
+
text: `*${botName} DEEPSEEK*\n\nUsage: .deepseek <question>\nExample: .deepseek explain neural networks`
|
|
42
|
+
}, { quoted: fake });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
await sock.sendMessage(chatId, { react: { text: '🔍', key: message.key } });
|
|
46
|
+
|
|
47
|
+
// FIXED: Only working Deepseek APIs
|
|
48
|
+
const result = await tryAPIs([
|
|
49
|
+
{
|
|
50
|
+
url: `https://api.dreaded.site/api/deepseek?text=${encodeURIComponent(query)}`,
|
|
51
|
+
parse: d => d.response || d.result || d.message
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
url: `https://bk9.fun/ai/deepseek?q=${encodeURIComponent(query)}`,
|
|
55
|
+
parse: d => d.BK9 || d.result || d.data
|
|
56
|
+
}
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
if (result) {
|
|
60
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
61
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
62
|
+
} else {
|
|
63
|
+
await sock.sendMessage(chatId, {
|
|
64
|
+
text: `*${botName}*\nDeepSeek is currently unavailable. Try again later.`
|
|
65
|
+
}, { quoted: fake });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ==================== LLAMA (WORKING) ====================
|
|
70
|
+
async function llamaCommand(sock, chatId, message, args) {
|
|
71
|
+
const fake = createFakeContact(message);
|
|
72
|
+
const botName = getBotName();
|
|
73
|
+
const query = args.join(' ').trim();
|
|
74
|
+
|
|
75
|
+
if (!query) {
|
|
76
|
+
return sock.sendMessage(chatId, {
|
|
77
|
+
text: `*${botName} LLAMA*\n\nUsage: .llama <question>\nExample: .llama write a python hello world`
|
|
78
|
+
}, { quoted: fake });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await sock.sendMessage(chatId, { react: { text: '🦙', key: message.key } });
|
|
82
|
+
|
|
83
|
+
const result = await tryAPIs([
|
|
84
|
+
{ url: `https://bk9.fun/ai/llama?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
85
|
+
{ url: `https://api.dreaded.site/api/llama?text=${encodeURIComponent(query)}`, parse: d => d.response || d.result },
|
|
86
|
+
{ url: `https://api.siputzx.my.id/api/ai/llama33-70b?content=${encodeURIComponent(query)}`, parse: d => d.data },
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
if (result) {
|
|
90
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
91
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
92
|
+
} else {
|
|
93
|
+
await sock.sendMessage(chatId, {
|
|
94
|
+
text: `*${botName}*\nLlama is currently unavailable. Try again later.`
|
|
95
|
+
}, { quoted: fake });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ==================== MIXTRAL (WORKING) ====================
|
|
100
|
+
async function mixtralCommand(sock, chatId, message, args) {
|
|
101
|
+
const fake = createFakeContact(message);
|
|
102
|
+
const botName = getBotName();
|
|
103
|
+
const query = args.join(' ').trim();
|
|
104
|
+
|
|
105
|
+
if (!query) {
|
|
106
|
+
return sock.sendMessage(chatId, {
|
|
107
|
+
text: `*${botName} MIXTRAL*\n\nUsage: .mixtral <question>\nExample: .mixtral explain APIs`
|
|
108
|
+
}, { quoted: fake });
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
await sock.sendMessage(chatId, { react: { text: '🔮', key: message.key } });
|
|
112
|
+
|
|
113
|
+
const result = await tryAPIs([
|
|
114
|
+
{ url: `https://bk9.fun/ai/mixtral?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
115
|
+
{ url: `https://api.siputzx.my.id/api/ai/mixtral-8x7b?content=${encodeURIComponent(query)}`, parse: d => d.data },
|
|
116
|
+
]);
|
|
117
|
+
|
|
118
|
+
if (result) {
|
|
119
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
120
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
121
|
+
} else {
|
|
122
|
+
await sock.sendMessage(chatId, {
|
|
123
|
+
text: `*${botName}*\nMixtral is currently unavailable. Try again later.`
|
|
124
|
+
}, { quoted: fake });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ==================== QWEN (WORKING) ====================
|
|
129
|
+
async function qwenCommand(sock, chatId, message, args) {
|
|
130
|
+
const fake = createFakeContact(message);
|
|
131
|
+
const botName = getBotName();
|
|
132
|
+
const query = args.join(' ').trim();
|
|
133
|
+
|
|
134
|
+
if (!query) {
|
|
135
|
+
return sock.sendMessage(chatId, {
|
|
136
|
+
text: `*${botName} QWEN*\n\nUsage: .qwen <question>\nExample: .qwen what is machine learning`
|
|
137
|
+
}, { quoted: fake });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
await sock.sendMessage(chatId, { react: { text: '🐉', key: message.key } });
|
|
141
|
+
|
|
142
|
+
const result = await tryAPIs([
|
|
143
|
+
{ url: `https://bk9.fun/ai/qwen?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
144
|
+
{ url: `https://api.siputzx.my.id/api/ai/qwen2.5-32b?content=${encodeURIComponent(query)}`, parse: d => d.data },
|
|
145
|
+
]);
|
|
146
|
+
|
|
147
|
+
if (result) {
|
|
148
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
149
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
150
|
+
} else {
|
|
151
|
+
await sock.sendMessage(chatId, {
|
|
152
|
+
text: `*${botName}*\nQwen is currently unavailable. Try again later.`
|
|
153
|
+
}, { quoted: fake });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ==================== CLAUDE (WORKING) ====================
|
|
158
|
+
async function claudeCommand(sock, chatId, message, args) {
|
|
159
|
+
const fake = createFakeContact(message);
|
|
160
|
+
const botName = getBotName();
|
|
161
|
+
const query = args.join(' ').trim();
|
|
162
|
+
|
|
163
|
+
if (!query) {
|
|
164
|
+
return sock.sendMessage(chatId, {
|
|
165
|
+
text: `*${botName} CLAUDE*\n\nUsage: .claude <question>\nExample: .claude explain recursion`
|
|
166
|
+
}, { quoted: fake });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
await sock.sendMessage(chatId, { react: { text: '🤖', key: message.key } });
|
|
170
|
+
|
|
171
|
+
const result = await tryAPIs([
|
|
172
|
+
{ url: `https://bk9.fun/ai/claude?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
173
|
+
{ url: `https://api.dreaded.site/api/claude?text=${encodeURIComponent(query)}`, parse: d => d.response || d.result },
|
|
174
|
+
]);
|
|
175
|
+
|
|
176
|
+
if (result) {
|
|
177
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
178
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
179
|
+
} else {
|
|
180
|
+
await sock.sendMessage(chatId, {
|
|
181
|
+
text: `*${botName}*\nClaude is currently unavailable. Try again later.`
|
|
182
|
+
}, { quoted: fake });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// ==================== GPT-4O (WORKING) ====================
|
|
187
|
+
async function gpt4oCommand(sock, chatId, message, args) {
|
|
188
|
+
const fake = createFakeContact(message);
|
|
189
|
+
const botName = getBotName();
|
|
190
|
+
const query = args.join(' ').trim();
|
|
191
|
+
|
|
192
|
+
if (!query) {
|
|
193
|
+
return sock.sendMessage(chatId, {
|
|
194
|
+
text: `*${botName} GPT-4O*\n\nUsage: .gpt4o <question>\nExample: .gpt4o explain blockchain`
|
|
195
|
+
}, { quoted: fake });
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
await sock.sendMessage(chatId, { react: { text: '⚡', key: message.key } });
|
|
199
|
+
|
|
200
|
+
const result = await tryAPIs([
|
|
201
|
+
{ url: `https://bk9.fun/ai/GPT4o?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
202
|
+
{ url: `https://api.dreaded.site/api/chatgpt?text=${encodeURIComponent(query)}`, parse: d => d.response || d.result },
|
|
203
|
+
{ url: `https://api.siputzx.my.id/api/ai/gpt-4o?content=${encodeURIComponent(query)}`, parse: d => d.data },
|
|
204
|
+
]);
|
|
205
|
+
|
|
206
|
+
if (result) {
|
|
207
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
208
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
209
|
+
} else {
|
|
210
|
+
await sock.sendMessage(chatId, {
|
|
211
|
+
text: `*${botName}*\nGPT-4o is currently unavailable. Try again later.`
|
|
212
|
+
}, { quoted: fake });
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ==================== MISTRAL (WORKING) ====================
|
|
217
|
+
async function mistralCommand(sock, chatId, message, args) {
|
|
218
|
+
const fake = createFakeContact(message);
|
|
219
|
+
const botName = getBotName();
|
|
220
|
+
const query = args.join(' ').trim();
|
|
221
|
+
|
|
222
|
+
if (!query) {
|
|
223
|
+
return sock.sendMessage(chatId, {
|
|
224
|
+
text: `*${botName} MISTRAL*\n\nUsage: .mistral <question>\nExample: .mistral explain docker containers`
|
|
225
|
+
}, { quoted: fake });
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
await sock.sendMessage(chatId, { react: { text: '🌬️', key: message.key } });
|
|
229
|
+
|
|
230
|
+
const result = await tryAPIs([
|
|
231
|
+
{ url: `https://bk9.fun/ai/mistral?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
232
|
+
{ url: `https://api.siputzx.my.id/api/ai/mistral-nemo?content=${encodeURIComponent(query)}`, parse: d => d.data },
|
|
233
|
+
]);
|
|
234
|
+
|
|
235
|
+
if (result) {
|
|
236
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
237
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
238
|
+
} else {
|
|
239
|
+
await sock.sendMessage(chatId, {
|
|
240
|
+
text: `*${botName}*\nMistral is currently unavailable. Try again later.`
|
|
241
|
+
}, { quoted: fake });
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// ==================== GEMMA (WORKING) ====================
|
|
246
|
+
async function gemmaCommand(sock, chatId, message, args) {
|
|
247
|
+
const fake = createFakeContact(message);
|
|
248
|
+
const botName = getBotName();
|
|
249
|
+
const query = args.join(' ').trim();
|
|
250
|
+
|
|
251
|
+
if (!query) {
|
|
252
|
+
return sock.sendMessage(chatId, {
|
|
253
|
+
text: `*${botName} GEMMA*\n\nUsage: .gemma <question>\nExample: .gemma explain REST APIs`
|
|
254
|
+
}, { quoted: fake });
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
await sock.sendMessage(chatId, { react: { text: '💎', key: message.key } });
|
|
258
|
+
|
|
259
|
+
const result = await tryAPIs([
|
|
260
|
+
{ url: `https://bk9.fun/ai/gemma?q=${encodeURIComponent(query)}`, parse: d => d.BK9 || d.result },
|
|
261
|
+
{ url: `https://api.siputzx.my.id/api/ai/gemma2-9b?content=${encodeURIComponent(query)}`, parse: d => d.data },
|
|
262
|
+
]);
|
|
263
|
+
|
|
264
|
+
if (result) {
|
|
265
|
+
await sock.sendMessage(chatId, { text: result }, { quoted: fake });
|
|
266
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
267
|
+
} else {
|
|
268
|
+
await sock.sendMessage(chatId, {
|
|
269
|
+
text: `*${botName}*\nGemma is currently unavailable. Try again later.`
|
|
270
|
+
}, { quoted: fake });
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// ==================== EXPORTS (EXACTLY AS BEFORE) ====================
|
|
275
|
+
module.exports = {
|
|
276
|
+
deepseekCommand,
|
|
277
|
+
llamaCommand,
|
|
278
|
+
mixtralCommand,
|
|
279
|
+
qwenCommand,
|
|
280
|
+
claudeCommand,
|
|
281
|
+
gpt4oCommand,
|
|
282
|
+
mistralCommand,
|
|
283
|
+
gemmaCommand
|
|
284
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const { createFakeContact, getBotName } = require('../../davelib/fakeContact');
|
|
2
|
+
const axios = require('axios');
|
|
3
|
+
|
|
4
|
+
async function aivideoCommand(sock, chatId, message, args) {
|
|
5
|
+
const fakeContact = createFakeContact(message);
|
|
6
|
+
const botName = getBotName();
|
|
7
|
+
const prompt = args.join(' ').trim();
|
|
8
|
+
|
|
9
|
+
if (!prompt) {
|
|
10
|
+
return sock.sendMessage(chatId, { text: `*${botName} AI VIDEO*\n\nUsage: .aivideo <prompt>\nExample: .aivideo a sunset over the ocean` }, { quoted: fakeContact });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
await sock.sendMessage(chatId, { react: { text: '🎬', key: message.key } });
|
|
14
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nGenerating video from: "${prompt}"\nThis may take a moment...` }, { quoted: fakeContact });
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const res = await axios.get(`https://bk9.fun/ai/Kling?prompt=${encodeURIComponent(prompt)}`, { timeout: 60000 });
|
|
18
|
+
const videoUrl = res.data?.BK9 || res.data?.result || res.data?.url;
|
|
19
|
+
|
|
20
|
+
if (videoUrl) {
|
|
21
|
+
await sock.sendMessage(chatId, { video: { url: videoUrl }, caption: `*${botName} AI VIDEO*\nPrompt: ${prompt}` }, { quoted: fakeContact });
|
|
22
|
+
await sock.sendMessage(chatId, { react: { text: '✅', key: message.key } });
|
|
23
|
+
} else {
|
|
24
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nFailed to generate video. Try a different prompt.` }, { quoted: fakeContact });
|
|
25
|
+
}
|
|
26
|
+
} catch (err) {
|
|
27
|
+
await sock.sendMessage(chatId, { text: `*${botName}*\nVideo generation failed: ${err.message}` }, { quoted: fakeContact });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = aivideoCommand;
|