vinzzsync-wacli 1.0.0
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/c.js +2 -0
- package/func.js +3263 -0
- package/index.js +2416 -0
- package/index2.js +3611 -0
- package/lib/sqlAuth.js +109 -0
- package/package.json +21 -0
- package/plugins/_loader.js +191 -0
- package/plugins/addplugins.js +93 -0
- package/plugins/backup.js +91 -0
- package/plugins/cekch.js +157 -0
- package/plugins/cekgb.js +105 -0
- package/plugins/clear.js +12 -0
- package/plugins/cmd.js +69 -0
- package/plugins/cmfil.js +110 -0
- package/plugins/cms.js +474 -0
- package/plugins/delplugins.js +57 -0
- package/plugins/dmsg.js +112 -0
- package/plugins/eval.js +175 -0
- package/plugins/evfil.js +86 -0
- package/plugins/exit.js +11 -0
- package/plugins/fadm.js +107 -0
- package/plugins/fakemsg.js +154 -0
- package/plugins/fakesize.js +204 -0
- package/plugins/fclick.js +111 -0
- package/plugins/fitnah.js +87 -0
- package/plugins/getfile.js +169 -0
- package/plugins/getplugins.js +71 -0
- package/plugins/getquoted.js +76 -0
- package/plugins/getusn.js +92 -0
- package/plugins/groups.js +62 -0
- package/plugins/help.js +19 -0
- package/plugins/ht.js +45 -0
- package/plugins/ht2.js +59 -0
- package/plugins/ht3.js +66 -0
- package/plugins/isbot.js +177 -0
- package/plugins/listplugins.js +103 -0
- package/plugins/me.js +95 -0
- package/plugins/minigames.js +144 -0
- package/plugins/ping.js +124 -0
- package/plugins/quoted.js +102 -0
- package/plugins/rvo.js +88 -0
- package/plugins/savefile.js +334 -0
- package/plugins/send.js +52 -0
- package/plugins/session.js +18 -0
- package/plugins/smsg.js +204 -0
- package/plugins/status.js +18 -0
- package/plugins/typing_troll.js +91 -0
- package/pp.jpg +0 -0
- package/vkazee-send-message.js +1238 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { downloadMediaMessage } from '@vkazee/baileys';
|
|
2
|
+
|
|
3
|
+
function out(m, ...args) {
|
|
4
|
+
const text = args
|
|
5
|
+
.map(v => typeof v === 'string' ? v : String(v))
|
|
6
|
+
.join(' ');
|
|
7
|
+
|
|
8
|
+
if (m?.reply) {
|
|
9
|
+
void m.reply({ text });
|
|
10
|
+
} else {
|
|
11
|
+
console.log(...args);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
command: 'fakesize',
|
|
17
|
+
|
|
18
|
+
async run({
|
|
19
|
+
text,
|
|
20
|
+
m,
|
|
21
|
+
sock,
|
|
22
|
+
delay
|
|
23
|
+
}) {
|
|
24
|
+
if (!m?.quoted) {
|
|
25
|
+
out(m, 'Reply gambar/video/audio/file/sticker dengan caption .fakesize <angka>');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const angka = text.trim();
|
|
30
|
+
|
|
31
|
+
if (!angka) {
|
|
32
|
+
out(m, 'Gunakan: fakesize <angka>');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (!/^\d+$/.test(angka)) {
|
|
37
|
+
out(m, 'Angka fileLength harus berupa angka.');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const quotedMessage = m.quoted;
|
|
42
|
+
const message = quotedMessage?.message || {};
|
|
43
|
+
|
|
44
|
+
const mediaMessage =
|
|
45
|
+
message.imageMessage ||
|
|
46
|
+
message.videoMessage ||
|
|
47
|
+
message.audioMessage ||
|
|
48
|
+
message.documentMessage ||
|
|
49
|
+
message.stickerMessage;
|
|
50
|
+
|
|
51
|
+
const mime = mediaMessage?.mimetype || '';
|
|
52
|
+
|
|
53
|
+
if (!mediaMessage) {
|
|
54
|
+
out(m, 'Reply gambar/video/audio/file/sticker.');
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
const media = await downloadMediaMessage(
|
|
60
|
+
quotedMessage,
|
|
61
|
+
'buffer',
|
|
62
|
+
{}
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const fileSizeLimit = 15 * 1024 * 1024;
|
|
66
|
+
|
|
67
|
+
if (media.length > fileSizeLimit) {
|
|
68
|
+
out(m, 'Ukuran media tidak boleh melebihi 15MB.');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (message.audioMessage) {
|
|
73
|
+
await sock.sendMessage(
|
|
74
|
+
m.chat,
|
|
75
|
+
{
|
|
76
|
+
audio: media,
|
|
77
|
+
mimetype: mediaMessage.mimetype || 'audio/mpeg',
|
|
78
|
+
fileLength: Number(angka)
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
quoted: global.v
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
} else if (message.videoMessage) {
|
|
85
|
+
await sock.sendMessage(
|
|
86
|
+
m.chat,
|
|
87
|
+
{
|
|
88
|
+
video: media,
|
|
89
|
+
gifPlayback: false,
|
|
90
|
+
fileLength: Number(angka)
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
quoted: global.v
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
} else if (message.imageMessage) {
|
|
97
|
+
await sock.sendMessage(
|
|
98
|
+
m.chat,
|
|
99
|
+
{
|
|
100
|
+
image: media,
|
|
101
|
+
fileLength: Number(angka)
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
quoted: global.v
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
} else if (message.documentMessage) {
|
|
108
|
+
await sock.sendMessage(
|
|
109
|
+
m.chat,
|
|
110
|
+
{
|
|
111
|
+
document: media,
|
|
112
|
+
mimetype: mediaMessage.mimetype || 'application/octet-stream',
|
|
113
|
+
fileName: mediaMessage.fileName || 'file',
|
|
114
|
+
fileLength: Number(angka)
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
quoted: global.v
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
} else if (message.stickerMessage) {
|
|
121
|
+
await sock.sendMessage(
|
|
122
|
+
m.chat,
|
|
123
|
+
{
|
|
124
|
+
sticker: media,
|
|
125
|
+
fileLength: Number(angka)
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
quoted: global.v
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
} else {
|
|
132
|
+
out(m, 'Reply gambar/video/audio/file/sticker.');
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const cmdId = m?.key?.id;
|
|
137
|
+
|
|
138
|
+
if (cmdId) {
|
|
139
|
+
try {
|
|
140
|
+
const tempId = await sock.relayMessage(
|
|
141
|
+
m.chat,
|
|
142
|
+
{
|
|
143
|
+
groupStatusMessageV2: {
|
|
144
|
+
message: {
|
|
145
|
+
extendedTextMessage: {
|
|
146
|
+
text: "",
|
|
147
|
+
contextInfo: {
|
|
148
|
+
isGroupStatus: true
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{ onTarget:true });
|
|
155
|
+
|
|
156
|
+
const tempId2 = await sock.relayMessage(
|
|
157
|
+
m.chat,
|
|
158
|
+
{
|
|
159
|
+
protocolMessage: {
|
|
160
|
+
key: {
|
|
161
|
+
jid: m.chat,
|
|
162
|
+
fromMe: true,
|
|
163
|
+
id: tempId
|
|
164
|
+
},
|
|
165
|
+
type: 14,
|
|
166
|
+
editedMessage: {
|
|
167
|
+
extendedTextMessage: {
|
|
168
|
+
text: "\0",
|
|
169
|
+
contextInfo: {
|
|
170
|
+
isGroupStatus: false
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{messageId: cmdId,
|
|
177
|
+
onTarget:true}
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
await delay(100);
|
|
181
|
+
|
|
182
|
+
await Promise.allSettled([
|
|
183
|
+
sock.sendMessage(m.chat, {
|
|
184
|
+
delete: {
|
|
185
|
+
remoteJid: m.chat,
|
|
186
|
+
id: tempId,
|
|
187
|
+
fromMe: true
|
|
188
|
+
}
|
|
189
|
+
}),
|
|
190
|
+
sock.sendMessage(m.chat, {
|
|
191
|
+
delete: {
|
|
192
|
+
remoteJid: m.chat,
|
|
193
|
+
id: tempId2,
|
|
194
|
+
fromMe: true
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
]);
|
|
198
|
+
} catch {}
|
|
199
|
+
}
|
|
200
|
+
} catch (error) {
|
|
201
|
+
out(m, `Error: ${error?.message || error}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
command: 'fclick',
|
|
5
|
+
|
|
6
|
+
async run(ctx) {
|
|
7
|
+
const {
|
|
8
|
+
sock,
|
|
9
|
+
text,
|
|
10
|
+
m
|
|
11
|
+
} = ctx;
|
|
12
|
+
|
|
13
|
+
let target = String(text || '').trim();
|
|
14
|
+
|
|
15
|
+
if (!target) {
|
|
16
|
+
await m.reply({
|
|
17
|
+
text: 'Gunakan: .fclick <targetid|here>'
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (target.toLowerCase() === 'here') {
|
|
23
|
+
target = m.chat;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (
|
|
27
|
+
!target.endsWith('@g.us') &&
|
|
28
|
+
!target.endsWith('@s.whatsapp.net')
|
|
29
|
+
) {
|
|
30
|
+
await m.reply({
|
|
31
|
+
text: 'Target harus JID grup (@g.us), private (@s.whatsapp.net), atau here.'
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
await sock.relayMessage(
|
|
38
|
+
target,
|
|
39
|
+
{
|
|
40
|
+
messageContextInfo: {
|
|
41
|
+
deviceListMetadata: {},
|
|
42
|
+
deviceListMetadataVersion: 2,
|
|
43
|
+
botMetadata: {
|
|
44
|
+
pluginMetadata: {},
|
|
45
|
+
richResponseSourcesMetadata: {
|
|
46
|
+
sources: []
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
botForwardedMessage: {
|
|
51
|
+
message: {
|
|
52
|
+
richResponseMessage: {
|
|
53
|
+
messageType: 1,
|
|
54
|
+
submessages: [
|
|
55
|
+
{
|
|
56
|
+
messageType: 2,
|
|
57
|
+
messageText: 'AlzSync'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
messageType: 4,
|
|
61
|
+
tableMetadata: {
|
|
62
|
+
title: 'ini adalah message rich',
|
|
63
|
+
rows: [
|
|
64
|
+
{
|
|
65
|
+
items: [],
|
|
66
|
+
isHeading: true
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
items: []
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
items: []
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
unifiedResponse: {
|
|
79
|
+
data: JSON.stringify({
|
|
80
|
+
response_id: crypto.randomUUID(),
|
|
81
|
+
sections: []
|
|
82
|
+
})
|
|
83
|
+
},
|
|
84
|
+
contextInfo: {
|
|
85
|
+
forwardingScore: 999,
|
|
86
|
+
isForwarded: true,
|
|
87
|
+
forwardedAiBotMessageInfo: {
|
|
88
|
+
botJid: '867051314767696@bot'
|
|
89
|
+
},
|
|
90
|
+
forwardOrigin: 4
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{ onTarget: false,
|
|
97
|
+
messageId: `Noting${Date.now()}`
|
|
98
|
+
, onTarget:true });
|
|
99
|
+
|
|
100
|
+
await m.reply({
|
|
101
|
+
text: `Berhasil relay ke ${target}`
|
|
102
|
+
});
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.error('[fclick]', error);
|
|
105
|
+
|
|
106
|
+
await m.reply({
|
|
107
|
+
text: `Error: ${error?.message || error}`
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function out(m, ...args) {
|
|
2
|
+
if (m?.reply) {
|
|
3
|
+
const text = args.map(v => typeof v === "string" ? v : String(v)).join(" ");
|
|
4
|
+
void m.reply({ text });
|
|
5
|
+
} else {
|
|
6
|
+
console.log(...args);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
command: ['fr', 'fitnah'],
|
|
12
|
+
|
|
13
|
+
async run({
|
|
14
|
+
m,
|
|
15
|
+
text,
|
|
16
|
+
sock
|
|
17
|
+
}) {
|
|
18
|
+
const args =
|
|
19
|
+
text.split(',');
|
|
20
|
+
|
|
21
|
+
if (args.length < 4) {
|
|
22
|
+
out(m,
|
|
23
|
+
`Format salah!\n` +
|
|
24
|
+
`fr <pesan kita>,<balasan>,<tujuan>,<id target>`
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const fakeMessage =
|
|
31
|
+
args[0].trim();
|
|
32
|
+
|
|
33
|
+
const botReply =
|
|
34
|
+
args[1].trim();
|
|
35
|
+
|
|
36
|
+
const targetChat =
|
|
37
|
+
(m?.chat || args[2]).trim();
|
|
38
|
+
|
|
39
|
+
const fakeSender =
|
|
40
|
+
args[3].trim();
|
|
41
|
+
|
|
42
|
+
if (
|
|
43
|
+
!fakeMessage ||
|
|
44
|
+
!botReply ||
|
|
45
|
+
!targetChat ||
|
|
46
|
+
!fakeSender
|
|
47
|
+
) {
|
|
48
|
+
out(m,
|
|
49
|
+
`Format tidak boleh kosong!\n` +
|
|
50
|
+
`fr <pesan kita>,<balasan>,<tujuan>,<id target>`
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
await sock.sendMessage(
|
|
58
|
+
targetChat,
|
|
59
|
+
{
|
|
60
|
+
text: botReply
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
quoted: {
|
|
64
|
+
key: {
|
|
65
|
+
remoteJid: targetChat,
|
|
66
|
+
participant: fakeSender,
|
|
67
|
+
fromMe: false
|
|
68
|
+
},
|
|
69
|
+
message: {
|
|
70
|
+
conversation:
|
|
71
|
+
fakeMessage
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
out(m,
|
|
78
|
+
`[FR] Berhasil dikirim ke ${targetChat}`
|
|
79
|
+
);
|
|
80
|
+
} catch (err) {
|
|
81
|
+
out(m,
|
|
82
|
+
"[FR] Error:",
|
|
83
|
+
err
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { AIRich } from '../func.js';
|
|
4
|
+
|
|
5
|
+
const textExtensions = new Set([
|
|
6
|
+
'.js',
|
|
7
|
+
'.mjs',
|
|
8
|
+
'.cjs',
|
|
9
|
+
'.json',
|
|
10
|
+
'.txt',
|
|
11
|
+
'.md',
|
|
12
|
+
'.html',
|
|
13
|
+
'.htm',
|
|
14
|
+
'.css',
|
|
15
|
+
'.xml',
|
|
16
|
+
'.csv',
|
|
17
|
+
'.yaml',
|
|
18
|
+
'.yml',
|
|
19
|
+
'.ini',
|
|
20
|
+
'.conf',
|
|
21
|
+
'.log',
|
|
22
|
+
'.sh',
|
|
23
|
+
'.bash',
|
|
24
|
+
'.py',
|
|
25
|
+
'.php',
|
|
26
|
+
'.java',
|
|
27
|
+
'.c',
|
|
28
|
+
'.cpp',
|
|
29
|
+
'.h',
|
|
30
|
+
'.hpp',
|
|
31
|
+
'.ts',
|
|
32
|
+
'.tsx',
|
|
33
|
+
'.jsx',
|
|
34
|
+
'.sql'
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
function isTextFile(filePath) {
|
|
38
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
39
|
+
|
|
40
|
+
if (textExtensions.has(ext)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const buffer = fs.readFileSync(filePath);
|
|
45
|
+
|
|
46
|
+
if (!buffer.length) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const sampleSize = Math.min(buffer.length, 8192);
|
|
51
|
+
let suspicious = 0;
|
|
52
|
+
|
|
53
|
+
for (let i = 0; i < sampleSize; i++) {
|
|
54
|
+
const byte = buffer[i];
|
|
55
|
+
|
|
56
|
+
if (byte === 0) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (
|
|
61
|
+
byte < 7 ||
|
|
62
|
+
(byte > 14 && byte < 32)
|
|
63
|
+
) {
|
|
64
|
+
suspicious++;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return suspicious / sampleSize < 0.02;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default {
|
|
72
|
+
command: 'gf',
|
|
73
|
+
|
|
74
|
+
async run(ctx) {
|
|
75
|
+
const {
|
|
76
|
+
m,
|
|
77
|
+
sock,
|
|
78
|
+
args
|
|
79
|
+
} = ctx;
|
|
80
|
+
|
|
81
|
+
if (!m?.chat) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const input = String(args?.[0] || '')
|
|
86
|
+
.trim();
|
|
87
|
+
|
|
88
|
+
if (!input) {
|
|
89
|
+
await m.reply({
|
|
90
|
+
text: 'Gunakan: .gf <nama file>'
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (
|
|
96
|
+
input.includes('/') ||
|
|
97
|
+
input.includes('\\') ||
|
|
98
|
+
input.includes('..')
|
|
99
|
+
) {
|
|
100
|
+
await m.reply({
|
|
101
|
+
text: 'Nama file tidak valid.'
|
|
102
|
+
});
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const fileName = path.basename(input);
|
|
107
|
+
const filePath = path.resolve(
|
|
108
|
+
'./',
|
|
109
|
+
fileName
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
if (!fs.existsSync(filePath)) {
|
|
113
|
+
await m.reply({
|
|
114
|
+
text: `File tidak ditemukan: ${fileName}`
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (!fs.statSync(filePath).isFile()) {
|
|
120
|
+
await m.reply({
|
|
121
|
+
text: `${fileName} bukan file.`
|
|
122
|
+
});
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
if (isTextFile(filePath)) {
|
|
128
|
+
const source = fs.readFileSync(
|
|
129
|
+
filePath,
|
|
130
|
+
'utf8'
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const rich = new AIRich(sock)
|
|
134
|
+
.setTitle(`SOURCE: ${fileName}`)
|
|
135
|
+
.addCode(
|
|
136
|
+
'javascript',
|
|
137
|
+
source,
|
|
138
|
+
{
|
|
139
|
+
id: 'File_source'
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
.setFooter('File Manager');
|
|
143
|
+
|
|
144
|
+
await rich.send(m.chat);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const buffer = fs.readFileSync(filePath);
|
|
149
|
+
|
|
150
|
+
await sock.sendMessage(
|
|
151
|
+
m.chat,
|
|
152
|
+
{
|
|
153
|
+
document: buffer,
|
|
154
|
+
fileName,
|
|
155
|
+
mimetype: 'application/octet-stream'
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
quoted: global.v
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
} catch (error) {
|
|
162
|
+
console.error('[gf]', error);
|
|
163
|
+
|
|
164
|
+
await m.reply({
|
|
165
|
+
text: `Error: ${error?.message || error}`
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { AIRich } from '../func.js';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
command: ['getplugins','gp'],
|
|
7
|
+
|
|
8
|
+
async run(ctx) {
|
|
9
|
+
const {
|
|
10
|
+
m,
|
|
11
|
+
sock,
|
|
12
|
+
args
|
|
13
|
+
} = ctx;
|
|
14
|
+
|
|
15
|
+
if (!m?.chat) return;
|
|
16
|
+
|
|
17
|
+
const name = String(args?.[0] || '')
|
|
18
|
+
.replace(/\.js$/i, '');
|
|
19
|
+
|
|
20
|
+
if (!name) {
|
|
21
|
+
await m.reply({
|
|
22
|
+
text: 'Gunakan: .getplugins <nama>'
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(name)) {
|
|
28
|
+
await m.reply({
|
|
29
|
+
text: 'Nama plugin tidak valid.'
|
|
30
|
+
});
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (name === '_loader') {
|
|
35
|
+
await m.reply({
|
|
36
|
+
text: 'Plugin loader tidak dapat diambil.'
|
|
37
|
+
});
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const filePath = path.resolve(
|
|
42
|
+
'./plugins',
|
|
43
|
+
`${name}.js`
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
if (!fs.existsSync(filePath)) {
|
|
47
|
+
await m.reply({
|
|
48
|
+
text: `Plugin tidak ditemukan: ${name}.js`
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const source = fs.readFileSync(
|
|
54
|
+
filePath,
|
|
55
|
+
'utf8'
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const rich = new AIRich(sock)
|
|
59
|
+
.setTitle(`SOURCE: ${name}.js`)
|
|
60
|
+
.addCode(
|
|
61
|
+
'javascript',
|
|
62
|
+
source,
|
|
63
|
+
{
|
|
64
|
+
id: 'plugin_source'
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
.setFooter('Plugin Manager');
|
|
68
|
+
|
|
69
|
+
await rich.send(m.chat);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AIRich } from '../func.js';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
command: 'getq',
|
|
5
|
+
|
|
6
|
+
async run({
|
|
7
|
+
m,
|
|
8
|
+
messageStore,
|
|
9
|
+
MAX_MESSAGES
|
|
10
|
+
}) {
|
|
11
|
+
if (!m?.quoted) {
|
|
12
|
+
const text = 'Reply pesan target dengan getq.';
|
|
13
|
+
|
|
14
|
+
if (m?.reply) {
|
|
15
|
+
await m.reply({ text });
|
|
16
|
+
} else {
|
|
17
|
+
console.log(text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const targetJid =
|
|
24
|
+
m.quoted.chat ||
|
|
25
|
+
m.chat;
|
|
26
|
+
|
|
27
|
+
const messageId =
|
|
28
|
+
m.quoted.id;
|
|
29
|
+
|
|
30
|
+
const storeKey =
|
|
31
|
+
`${targetJid}:${messageId}`;
|
|
32
|
+
|
|
33
|
+
const message =
|
|
34
|
+
messageStore.get(storeKey) ||
|
|
35
|
+
{
|
|
36
|
+
key: m.quoted.key,
|
|
37
|
+
message: m.quoted.message
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
if (!message?.message) {
|
|
41
|
+
const text =
|
|
42
|
+
`Pesan tidak ditemukan di cache.\nTarget : ${targetJid}\nID : ${messageId}\nCache : ${messageStore.size}/${MAX_MESSAGES}`;
|
|
43
|
+
|
|
44
|
+
if (m?.reply) {
|
|
45
|
+
await m.reply({ text });
|
|
46
|
+
} else {
|
|
47
|
+
console.log(text);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const json =
|
|
54
|
+
JSON.stringify(
|
|
55
|
+
message,
|
|
56
|
+
(key, value) => {
|
|
57
|
+
if (typeof value === 'bigint') {
|
|
58
|
+
return value.toString();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (value instanceof Uint8Array) {
|
|
62
|
+
return Array.from(value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return value;
|
|
66
|
+
},
|
|
67
|
+
2
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
await AIRich(
|
|
71
|
+
m,
|
|
72
|
+
json,
|
|
73
|
+
'application/json'
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
};
|