natureco-cli 2.22.0 → 2.22.1
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/package.json +1 -1
- package/src/commands/gateway.js +9 -2
package/package.json
CHANGED
package/src/commands/gateway.js
CHANGED
|
@@ -197,9 +197,16 @@ async function startWhatsAppProvider(sessionDir, config) {
|
|
|
197
197
|
const ownNumber = sock.user?.id?.split(':')[0].replace('@s.whatsapp.net', '') || 'unknown';
|
|
198
198
|
console.log(chalk.cyan('[whatsapp]'), chalk.white(`Inbound message +${sender} -> +${ownNumber}`));
|
|
199
199
|
|
|
200
|
+
const trimmed = messageText.trim();
|
|
201
|
+
console.log(chalk.cyan('[whatsapp]'), chalk.gray(`msg: "${trimmed.slice(0, 80)}"`));
|
|
202
|
+
|
|
200
203
|
// ── !code komutu — headless code agent ─────────────────────────────
|
|
201
|
-
if (
|
|
202
|
-
const task =
|
|
204
|
+
if (trimmed.toLowerCase().startsWith('!code')) {
|
|
205
|
+
const task = trimmed.replace(/^!code\s*/i, '').trim();
|
|
206
|
+
if (!task) {
|
|
207
|
+
await sock.sendMessage(msg.key.remoteJid, { text: '⚙️ Kullanım: !code <görev>\nÖrnek: !code login sayfasına forgot password ekle' });
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
203
210
|
console.log(chalk.cyan('[whatsapp]'), chalk.yellow(`!code komutu: ${task.slice(0, 60)}`));
|
|
204
211
|
|
|
205
212
|
try {
|