natureco-cli 1.0.29 → 1.0.30
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/whatsapp.js +5 -0
package/package.json
CHANGED
package/src/commands/whatsapp.js
CHANGED
|
@@ -238,13 +238,18 @@ async function startWhatsAppConnection(sessionDir, botId, selectedBot, config, a
|
|
|
238
238
|
'';
|
|
239
239
|
|
|
240
240
|
if (messageText) {
|
|
241
|
+
console.log('📨 Mesaj alındı:', sender, messageText);
|
|
241
242
|
console.log(chalk.cyan(`\n📱 ${sender}:`), chalk.white(messageText));
|
|
242
243
|
|
|
243
244
|
try {
|
|
245
|
+
console.log('📡 API isteği gönderiliyor...');
|
|
244
246
|
const response = await sendMessage(config.apiKey, config.defaultBotId, messageText, null, '');
|
|
247
|
+
console.log('📩 API yanıtı:', JSON.stringify(response));
|
|
248
|
+
|
|
245
249
|
const reply = response?.reply || response?.message || '';
|
|
246
250
|
|
|
247
251
|
if (reply) {
|
|
252
|
+
console.log('📤 WhatsApp yanıtı gönderiliyor:', reply);
|
|
248
253
|
await sock.sendMessage(msg.key.remoteJid, { text: reply });
|
|
249
254
|
console.log(chalk.green(`✅ Cevap gönderildi: ${reply.substring(0, 50)}...`));
|
|
250
255
|
}
|