33 lines
1.0 KiB
Markdown
33 lines
1.0 KiB
Markdown
# KlonlanmaLal.js — handleCommand() (satır 109)
|
||
|
||
[← KlonlanmaLal.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
```javascript
|
||
function handleCommand(c, p, args) {
|
||
var text = trim(args);
|
||
var parts = text.length === 0 ? [] : text.split(/\s+/);
|
||
var first = parts.length > 0 ? lower(parts[0]) : "";
|
||
|
||
if (first === "temiz" || first === "sil" || first === "reset" || first === "stop") {
|
||
clearClones(c, true);
|
||
p.send("\u00a7a[Klon] Klonlar silindi.");
|
||
return;
|
||
}
|
||
|
||
if (first === "durum") {
|
||
var s = loadState();
|
||
p.send("\u00a77[Klon] aktif=" + s.active + " sayi=" + s.cloneIds.length + " run=" + s.runId);
|
||
return;
|
||
}
|
||
|
||
var refresh = first === "yenile" || first === "refresh";
|
||
var countText = refresh ? (parts[1] || "") : (parts[0] || "");
|
||
var count = parseInt(countText, 10);
|
||
|
||
if (!isFinite(count) || count <= 0) count = DEFAULT_COUNT;
|
||
count = Math.max(1, Math.min(MAX_COUNT, count));
|
||
|
||
spawnClones(c, p, count, true);
|
||
}
|
||
```
|