natureco-cli 1.0.51 → 1.0.52
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/README.md +186 -64
- package/package.json +1 -1
- package/src/commands/dashboard.js +2 -2
- package/src/utils/api.js +17 -1
package/README.md
CHANGED
|
@@ -4,80 +4,86 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[]()
|
|
6
6
|
|
|
7
|
-
Terminal-native AI agent CLI — chat with your bots, automate workflows, and connect Telegram, Discord, Slack &
|
|
7
|
+
Terminal-native AI agent CLI — chat with your bots, automate workflows, and connect Telegram, Discord, Slack & WhatsApp. A powerful alternative to Claude Code & OpenClaw.
|
|
8
8
|
|
|
9
|
-
## Features
|
|
9
|
+
## ✨ Features
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
11
|
+
- **🤖 Multi-Bot Chat** — Interactive conversations with AI bots, support for multi-word bot names, auto-selection when no default
|
|
12
|
+
- **🔌 Multi-Platform Integration** — Telegram, Discord, Slack, WhatsApp (QR code auth with Baileys)
|
|
13
|
+
- **🎯 Skill System** — Extend capabilities with NatureHub and ClawHub skills
|
|
14
|
+
- **🔧 MCP Support** — Model Context Protocol servers for filesystem, GitHub, databases
|
|
15
|
+
- **🌐 Web Dashboard** — Beautiful glassmorphism UI at localhost:3848 with animated gradients
|
|
16
|
+
- **⚡ Gateway Server** — Background process with WhatsApp auto-start, OpenClaw-style logging
|
|
17
|
+
- **🎨 Custom AI Providers** — OpenAI, Anthropic, Groq, Gemini with model selection
|
|
18
|
+
- **📝 Code Analysis** — Deep code review with security, performance, quality scoring
|
|
19
|
+
- **🔄 Automation** — Cron jobs, hooks, custom commands, background tasks
|
|
20
|
+
- **💾 Memory System** — Persistent conversation memory per bot
|
|
21
|
+
- **📊 System Health** — Built-in doctor command with auto-fix
|
|
21
22
|
|
|
22
|
-
## Quick Start
|
|
23
|
+
## 🚀 Quick Start
|
|
23
24
|
|
|
24
25
|
```bash
|
|
25
26
|
# Install globally
|
|
26
27
|
npm install -g natureco-cli
|
|
27
28
|
|
|
28
|
-
#
|
|
29
|
-
natureco
|
|
29
|
+
# Run setup wizard
|
|
30
|
+
natureco setup
|
|
30
31
|
|
|
31
32
|
# Start chatting
|
|
32
33
|
natureco chat
|
|
33
34
|
```
|
|
34
35
|
|
|
35
|
-
## Commands
|
|
36
|
+
## 📋 Commands
|
|
36
37
|
|
|
37
38
|
### Temel Komutlar
|
|
38
39
|
|
|
39
40
|
| Komut | Açıklama |
|
|
40
41
|
|-------|----------|
|
|
41
42
|
| `natureco` | Gateway ekranını açar — sistem durumu, aktif bot, skill sayısı |
|
|
42
|
-
| `natureco setup` | Kurulum
|
|
43
|
-
| `natureco login` | API key ile giriş yapar
|
|
43
|
+
| `natureco setup` | Kurulum sihirbazı — API key, bot seç, AI provider, model seç, entegrasyonlar |
|
|
44
|
+
| `natureco login` | API key ile giriş yapar |
|
|
44
45
|
| `natureco logout` | Çıkış yapar, config'i temizler |
|
|
45
46
|
| `natureco help` | Tüm komutları ve örnekleri listeler |
|
|
46
|
-
| `natureco doctor` | Sistem sağlık kontrolü — Node, API
|
|
47
|
-
| `natureco doctor --fix` | Sorunları otomatik onarır
|
|
48
|
-
| `natureco update` | Yeni versiyon
|
|
47
|
+
| `natureco doctor` | Sistem sağlık kontrolü — Node, API, bot, skill, entegrasyon |
|
|
48
|
+
| `natureco doctor --fix` | Sorunları otomatik onarır |
|
|
49
|
+
| `natureco update` | Yeni versiyon kontrolü |
|
|
49
50
|
|
|
50
51
|
### Sohbet
|
|
51
52
|
|
|
52
53
|
| Komut | Açıklama |
|
|
53
54
|
|-------|----------|
|
|
54
|
-
| `natureco chat` | Varsayılan botla interaktif
|
|
55
|
-
| `natureco chat
|
|
55
|
+
| `natureco chat` | Varsayılan botla sohbet (yoksa interaktif seçim) |
|
|
56
|
+
| `natureco chat Bot Adı` | Belirli botla sohbet (boşluklu isimler desteklenir) |
|
|
57
|
+
| `natureco chat Nature Bot V3` | Çok kelimeli bot adları otomatik birleştirilir |
|
|
56
58
|
| `natureco chat --resume` | En son oturuma devam eder |
|
|
57
|
-
| `natureco ask "soru"` | Tek seferlik soru sorar
|
|
58
|
-
| `natureco run script.md` | Markdown dosyasını
|
|
59
|
-
| `natureco bots` | Tüm
|
|
59
|
+
| `natureco ask "soru"` | Tek seferlik soru sorar |
|
|
60
|
+
| `natureco run script.md` | Markdown dosyasını prompt olarak gönderir |
|
|
61
|
+
| `natureco bots` | Tüm botları listeler |
|
|
60
62
|
|
|
61
63
|
**Chat İçi Komutlar:**
|
|
62
64
|
|
|
63
65
|
| Komut | Açıklama |
|
|
64
66
|
|-------|----------|
|
|
65
67
|
| `/clear` | Ekranı temizler |
|
|
66
|
-
| `/bot` | Bot
|
|
68
|
+
| `/bot` | Bot listesi gösterir veya bot değiştirir |
|
|
69
|
+
| `/bot Bot Adı` | Belirli bota geçer |
|
|
67
70
|
| `/skills` | Aktif skill'leri gösterir |
|
|
68
71
|
| `/memory` | Hafıza durumunu gösterir |
|
|
72
|
+
| `/memory clear` | Hafızayı temizler |
|
|
69
73
|
| `/commands` | Özel komutları listeler |
|
|
74
|
+
| `/ultrareview` | Son kod bloğunu detaylı inceler |
|
|
70
75
|
| `/help` | Chat yardımını gösterir |
|
|
71
|
-
| `exit`
|
|
76
|
+
| `exit` / `quit` | Sohbetten çıkar |
|
|
77
|
+
| `Ctrl+B` | Görevi arka plana al |
|
|
72
78
|
|
|
73
79
|
### Skill Sistemi
|
|
74
80
|
|
|
75
81
|
| Komut | Açıklama |
|
|
76
82
|
|-------|----------|
|
|
77
|
-
| `natureco skills` | Yüklü skill'leri listeler
|
|
83
|
+
| `natureco skills` | Yüklü skill'leri listeler |
|
|
78
84
|
| `natureco skills install slug` | NatureHub'dan skill yükler |
|
|
79
|
-
| `natureco skills install clawhub:slug` | ClawHub'dan skill yükler
|
|
80
|
-
| `natureco skills browse` | Popüler skill
|
|
85
|
+
| `natureco skills install clawhub:slug` | ClawHub'dan skill yükler |
|
|
86
|
+
| `natureco skills browse` | Popüler skill listesi, interaktif seçim |
|
|
81
87
|
| `natureco skills search "sorgu"` | Skill arar |
|
|
82
88
|
| `natureco skills remove slug` | Skill'i kaldırır |
|
|
83
89
|
| `natureco skills create ad` | Yeni skill şablonu oluşturur |
|
|
@@ -86,10 +92,13 @@ natureco chat
|
|
|
86
92
|
|
|
87
93
|
| Komut | Açıklama |
|
|
88
94
|
|-------|----------|
|
|
89
|
-
| `natureco telegram connect` | Telegram botunu bağlar (token +
|
|
95
|
+
| `natureco telegram connect` | Telegram botunu bağlar (token + user ID) |
|
|
90
96
|
| `natureco discord connect` | Discord botunu bağlar |
|
|
91
97
|
| `natureco slack connect` | Slack workspace'ine bağlanır |
|
|
92
|
-
| `natureco whatsapp connect` | WhatsApp
|
|
98
|
+
| `natureco whatsapp connect` | WhatsApp QR kod ile bağlanır (Baileys) |
|
|
99
|
+
| `natureco whatsapp status` | WhatsApp bağlantı durumu ve izin listesi |
|
|
100
|
+
| `natureco whatsapp allow <numara>` | İzin listesine numara ekler |
|
|
101
|
+
| `natureco whatsapp disconnect` | WhatsApp bağlantısını keser |
|
|
93
102
|
|
|
94
103
|
### MCP Sunucuları
|
|
95
104
|
|
|
@@ -98,40 +107,48 @@ natureco chat
|
|
|
98
107
|
| `natureco mcp list` | Bağlı MCP sunucularını listeler |
|
|
99
108
|
| `natureco mcp add` | MCP sunucu ekler (filesystem, github, postgres...) |
|
|
100
109
|
| `natureco mcp templates` | Hazır MCP şablonlarını listeler |
|
|
110
|
+
| `natureco mcp enable <name>` | MCP sunucusunu aktif eder |
|
|
111
|
+
| `natureco mcp disable <name>` | MCP sunucusunu devre dışı bırakır |
|
|
101
112
|
|
|
102
113
|
### Otomasyon
|
|
103
114
|
|
|
104
115
|
| Komut | Açıklama |
|
|
105
116
|
|-------|----------|
|
|
106
|
-
| `natureco ultrareview dosya.js` |
|
|
107
|
-
| `natureco git review` | Staged değişiklikleri
|
|
108
|
-
| `natureco git commit` | AI ile commit mesajı üretir
|
|
109
|
-
| `natureco cron add` | Zamanlanmış görev oluşturur
|
|
117
|
+
| `natureco ultrareview dosya.js` | Kod inceleme — güvenlik, performans, kalite puanlar |
|
|
118
|
+
| `natureco git review` | Staged değişiklikleri inceletir |
|
|
119
|
+
| `natureco git commit` | AI ile commit mesajı üretir |
|
|
120
|
+
| `natureco cron add` | Zamanlanmış görev oluşturur |
|
|
110
121
|
| `natureco cron list` | Cron görevlerini listeler |
|
|
111
122
|
| `natureco cron start` | Cron daemon'unu başlatır |
|
|
112
|
-
| `natureco
|
|
113
|
-
| `natureco
|
|
114
|
-
| `natureco commands create ad` | Özel /komut oluşturur (chat'te /ad ile kullan) |
|
|
123
|
+
| `natureco hooks create tip` | Hook oluşturur (pre-message, post-message...) |
|
|
124
|
+
| `natureco commands create ad` | Özel /komut oluşturur |
|
|
115
125
|
|
|
116
|
-
###
|
|
126
|
+
### Gateway & Dashboard
|
|
117
127
|
|
|
118
128
|
| Komut | Açıklama |
|
|
119
129
|
|-------|----------|
|
|
120
|
-
| `natureco
|
|
130
|
+
| `natureco gateway start` | Gateway'i arka planda başlatır (WhatsApp otomatik) |
|
|
131
|
+
| `natureco gateway stop` | Gateway'i durdurur |
|
|
132
|
+
| `natureco gateway status` | Gateway durumu (son 10 log) |
|
|
133
|
+
| `natureco gateway logs` | Tüm logları gösterir (~/.natureco/gateway.log) |
|
|
134
|
+
| `natureco dashboard` | Web arayüzü açar (localhost:3848) |
|
|
121
135
|
| `natureco dashboard stop` | Dashboard'u durdurur |
|
|
122
136
|
| `natureco dashboard status` | Dashboard durumunu kontrol eder |
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
137
|
+
|
|
138
|
+
### Yapılandırma
|
|
139
|
+
|
|
140
|
+
| Komut | Açıklama |
|
|
141
|
+
|-------|----------|
|
|
126
142
|
| `natureco config list` | Tüm ayarları gösterir |
|
|
127
|
-
| `natureco config
|
|
128
|
-
| `natureco
|
|
143
|
+
| `natureco config get key` | Belirli ayarı gösterir |
|
|
144
|
+
| `natureco config set key val` | Ayar değiştirir |
|
|
145
|
+
| `natureco init` | Proje klasörü oluşturur (.natureco/) |
|
|
129
146
|
|
|
130
|
-
## Integrations
|
|
147
|
+
## 🔌 Integrations
|
|
131
148
|
|
|
132
149
|
### Telegram
|
|
133
150
|
|
|
134
|
-
|
|
151
|
+
Telegram botunuzu bağlayın, mesajları alın ve yanıtlayın. Bot token ve kullanıcı ID ile kimlik doğrulama.
|
|
135
152
|
|
|
136
153
|
```bash
|
|
137
154
|
natureco telegram connect
|
|
@@ -139,7 +156,7 @@ natureco telegram connect
|
|
|
139
156
|
|
|
140
157
|
### Discord
|
|
141
158
|
|
|
142
|
-
|
|
159
|
+
Discord botlarını entegre edin. Sunucu kanalları, DM'ler ve slash komutları desteklenir.
|
|
143
160
|
|
|
144
161
|
```bash
|
|
145
162
|
natureco discord connect
|
|
@@ -147,7 +164,7 @@ natureco discord connect
|
|
|
147
164
|
|
|
148
165
|
### Slack
|
|
149
166
|
|
|
150
|
-
|
|
167
|
+
Slack workspace'lerine bağlanın. Kanal ve DM mesajlarını yönetin.
|
|
151
168
|
|
|
152
169
|
```bash
|
|
153
170
|
natureco slack connect
|
|
@@ -155,40 +172,145 @@ natureco slack connect
|
|
|
155
172
|
|
|
156
173
|
### WhatsApp
|
|
157
174
|
|
|
158
|
-
|
|
175
|
+
WhatsApp hesaplarını QR kod ile bağlayın. Baileys kütüphanesi ile tam medya desteği.
|
|
159
176
|
|
|
160
177
|
```bash
|
|
178
|
+
# İlk bağlantı (QR kod)
|
|
161
179
|
natureco whatsapp connect
|
|
180
|
+
|
|
181
|
+
# Gateway ile otomatik başlat
|
|
182
|
+
natureco gateway start
|
|
183
|
+
|
|
184
|
+
# İzin listesine numara ekle
|
|
185
|
+
natureco whatsapp allow 905551234567
|
|
186
|
+
|
|
187
|
+
# Durum kontrolü
|
|
188
|
+
natureco whatsapp status
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**WhatsApp Özellikleri:**
|
|
192
|
+
- QR kod ile terminal'de bağlantı
|
|
193
|
+
- Session persistence (~/.natureco/whatsapp-sessions/)
|
|
194
|
+
- İzin listesi kontrolü (son 10 hane karşılaştırma)
|
|
195
|
+
- Gateway ile otomatik başlatma
|
|
196
|
+
- OpenClaw-style logging
|
|
197
|
+
- Auto-reconnect (515, 408 hata kodları)
|
|
198
|
+
- Çoklu mesaj formatı desteği (text, caption, buttons, list...)
|
|
199
|
+
|
|
200
|
+
## 🌐 Gateway Server
|
|
201
|
+
|
|
202
|
+
Arka planda çalışan gateway sunucusu. WhatsApp otomatik başlatma, OpenClaw-style logging, health check.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Gateway'i başlat (arka planda)
|
|
206
|
+
natureco gateway start
|
|
207
|
+
|
|
208
|
+
# Logları canlı izle
|
|
209
|
+
tail -f ~/.natureco/gateway.log
|
|
210
|
+
|
|
211
|
+
# Durum kontrolü
|
|
212
|
+
natureco gateway status
|
|
213
|
+
|
|
214
|
+
# Durdur
|
|
215
|
+
natureco gateway stop
|
|
162
216
|
```
|
|
163
217
|
|
|
164
|
-
|
|
218
|
+
**Gateway Özellikleri:**
|
|
219
|
+
- Detached process (terminal kapatılsa bile çalışır)
|
|
220
|
+
- WhatsApp otomatik başlatma (config'de kayıtlıysa)
|
|
221
|
+
- OpenClaw-style log formatı: `[timestamp] [module] message`
|
|
222
|
+
- Health check her 60 saniyede
|
|
223
|
+
- Auto-restart on connection loss (10s delay)
|
|
224
|
+
- Platform-aware stop (SIGTERM → SIGKILL / taskkill)
|
|
225
|
+
- Tüm loglar ~/.natureco/gateway.log dosyasında
|
|
165
226
|
|
|
166
|
-
|
|
227
|
+
## 🎨 Dashboard
|
|
167
228
|
|
|
168
|
-
|
|
169
|
-
- Bot switching and configuration
|
|
170
|
-
- Skill and MCP management
|
|
171
|
-
- Live system stats and health monitoring
|
|
172
|
-
- Responsive design for desktop and mobile
|
|
229
|
+
Localhost:3848'de çalışan web arayüzü. Glassmorphism tasarım, animated gradient arka plan.
|
|
173
230
|
|
|
174
231
|
```bash
|
|
175
232
|
natureco dashboard
|
|
176
233
|
```
|
|
177
234
|
|
|
178
|
-
|
|
235
|
+
**Dashboard Özellikleri:**
|
|
236
|
+
- Modern glassmorphism UI
|
|
237
|
+
- Animated gradient background (natureco.me/landing ile aynı)
|
|
238
|
+
- Sol sidebar: Aktif bot, diğer botlar, kanallar, skill'ler, hafıza, sessions, sistem, cron jobs
|
|
239
|
+
- Sağ chat alanı: Bot avatar, model bilgisi, version badge
|
|
240
|
+
- Typing indicator (üç nokta animasyonu)
|
|
241
|
+
- Türkçe karakter desteği
|
|
242
|
+
- Responsive tasarım
|
|
243
|
+
|
|
244
|
+
## 🤖 Custom AI Providers
|
|
245
|
+
|
|
246
|
+
NatureCo dışında kendi AI provider'ınızı kullanın. Setup sırasında veya config ile ayarlayın.
|
|
247
|
+
|
|
248
|
+
**Desteklenen Provider'lar:**
|
|
249
|
+
- **OpenAI:** GPT-5.5, GPT-5.4, GPT-5, GPT-4.1, GPT-4o, o3, o4 Mini
|
|
250
|
+
- **Anthropic:** Claude Opus 4.7/4.6/4.5, Sonnet 4.6/4.5, Haiku 4.5/3.5
|
|
251
|
+
- **Groq:** Llama 3.3 70B, Llama 3.1 8B/70B, Mixtral 8x7B, Gemma 2 9B
|
|
252
|
+
- **Gemini:** 2.5 Pro/Flash, 2.0 Flash, 1.5 Pro/Flash
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
# Setup sırasında provider ve model seç
|
|
256
|
+
natureco setup
|
|
257
|
+
|
|
258
|
+
# Config ile değiştir
|
|
259
|
+
natureco config set aiProvider openai
|
|
260
|
+
natureco config set aiModel gpt-4o
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## 📁 File Structure
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
~/.natureco/
|
|
267
|
+
├── config.json # Ana yapılandırma
|
|
268
|
+
├── gateway.pid # Gateway process ID
|
|
269
|
+
├── gateway.log # Gateway logları
|
|
270
|
+
├── dashboard.pid # Dashboard process ID
|
|
271
|
+
├── skills/ # Yüklü skill'ler
|
|
272
|
+
├── memory/ # Bot hafızaları
|
|
273
|
+
├── history/ # Chat geçmişi
|
|
274
|
+
├── sessions/ # Chat oturumları
|
|
275
|
+
├── whatsapp-sessions/ # WhatsApp session'ları
|
|
276
|
+
│ └── {bot_id}/ # Bot bazında session
|
|
277
|
+
└── cron.json # Cron görevleri
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## 🔧 Configuration
|
|
281
|
+
|
|
282
|
+
Config dosyası: `~/.natureco/config.json`
|
|
283
|
+
|
|
284
|
+
**Örnek Config:**
|
|
285
|
+
```json
|
|
286
|
+
{
|
|
287
|
+
"apiKey": "nc_...",
|
|
288
|
+
"defaultBot": "Nature Bot",
|
|
289
|
+
"defaultBotId": "bot_123",
|
|
290
|
+
"aiProvider": "openai",
|
|
291
|
+
"aiModel": "gpt-4o",
|
|
292
|
+
"telegramToken": "...",
|
|
293
|
+
"discordToken": "...",
|
|
294
|
+
"whatsappConnected": true,
|
|
295
|
+
"whatsappBotId": "bot_123",
|
|
296
|
+
"whatsappPhone": "905551234567@s.whatsapp.net",
|
|
297
|
+
"whatsappAllowedNumbers": ["905551234567", "905422842631"]
|
|
298
|
+
}
|
|
299
|
+
```
|
|
179
300
|
|
|
180
|
-
## Support
|
|
301
|
+
## 📚 Support
|
|
181
302
|
|
|
182
303
|
- **Documentation:** [natureco.me/docs](https://natureco.me/docs)
|
|
183
304
|
- **CLI Docs:** [natureco.me/cli](https://natureco.me/cli)
|
|
184
305
|
- **npm Package:** [npmjs.com/package/natureco-cli](https://www.npmjs.com/package/natureco-cli)
|
|
185
|
-
- **GitHub Issues:** [github.com/natureco/cli/issues](https://github.com/natureco/cli/issues)
|
|
186
306
|
- **API Reference:** [natureco.me/api](https://natureco.me/api)
|
|
307
|
+
- **GitHub:** [github.com/natureco/cli](https://github.com/natureco/cli)
|
|
187
308
|
|
|
188
|
-
## License
|
|
309
|
+
## 📝 License
|
|
189
310
|
|
|
190
311
|
MIT © NatureCo
|
|
191
312
|
|
|
192
313
|
---
|
|
193
314
|
|
|
194
|
-
**Version:** 1.0.
|
|
315
|
+
**Version:** 1.0.51 | **Node.js:** >=16.0.0 | **Platform:** macOS, Windows, Linux
|
|
316
|
+
|
package/package.json
CHANGED
|
@@ -211,7 +211,7 @@ body::before{
|
|
|
211
211
|
<div class="header-bot-name" id="header-bot-name">Nature Bot</div>
|
|
212
212
|
<div class="header-bot-model" id="header-bot-model">NatureCo</div>
|
|
213
213
|
</div>
|
|
214
|
-
<div class="version-badge" id="version-badge">v1.0.
|
|
214
|
+
<div class="version-badge" id="version-badge">v1.0.52</div>
|
|
215
215
|
</div>
|
|
216
216
|
<div class="messages" id="messages"></div>
|
|
217
217
|
<div class="input-area">
|
|
@@ -341,7 +341,7 @@ function dashboard(action) {
|
|
|
341
341
|
apiKey: cfg.apiKey,
|
|
342
342
|
defaultBot: cfg.defaultBot,
|
|
343
343
|
defaultBotId: cfg.defaultBotId,
|
|
344
|
-
version: 'v1.0.
|
|
344
|
+
version: 'v1.0.52',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/utils/api.js
CHANGED
|
@@ -24,7 +24,7 @@ async function getBots(apiKey) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
async function
|
|
27
|
+
async function _sendMessage(apiKey, botId, message, conversationId = null, skillPrompts = '') {
|
|
28
28
|
const { getConfig } = require('./config');
|
|
29
29
|
const config = getConfig();
|
|
30
30
|
|
|
@@ -62,6 +62,22 @@ async function sendMessage(apiKey, botId, message, conversationId = null, skillP
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
async function sendMessage(...args) {
|
|
66
|
+
let result;
|
|
67
|
+
for (let i = 0; i < 3; i++) {
|
|
68
|
+
result = await _sendMessage(...args);
|
|
69
|
+
const reply = result?.reply || result?.message || '';
|
|
70
|
+
if (reply && !reply.includes('Şu an yanıt veremiyorum')) {
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
// Son denemede bekleme
|
|
74
|
+
if (i < 2) {
|
|
75
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
65
81
|
async function validateApiKey(apiKey) {
|
|
66
82
|
try {
|
|
67
83
|
const result = await getBots(apiKey);
|