Files

34 lines
982 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TelekinesiLal.js — parseCommand() (satır 629)
[← TelekinesiLal.js](index.md) · [← Master](../../wiki.md)
```javascript
function parseCommand(raw) {
var s = trim(raw);
if (s.length === 0) return null;
var lowerRaw = normalize(s);
var kisilAt = lowerRaw.indexOf("kisil");
if (kisilAt > 0) s = trim(s.substring(kisilAt));
var defolAt = lowerRaw.indexOf("defol");
if (defolAt > 0) s = trim(s.substring(defolAt));
if (s.charAt(0) === "/" || s.charAt(0) === "!") s = trim(s.substring(1));
var space = s.indexOf(" ");
var token = space < 0 ? s : s.substring(0, space);
var args = space < 0 ? "" : trim(s.substring(space + 1));
var cmd = normalize(token);
if (cmd === "defol") {
return { cmd: "defol", args: "defol" };
}
if (cmd === "kisil" || cmd === "kısıl" || cmd === "kisiltelekinezi") {
return { cmd: "kisil", args: args };
}
return null;
}
```