Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const nicks = ["x", "y", "z"]; // se leu mamou
- const tryName = async () => {
- for (let i = 0; i < nicks.length; i++) {
- let currentWord = nicks[i];
- await new Promise(r => setTimeout(r, 0));
- let res = await fetch(`antoniopedro.com/api/user/avatars/check-name?name=${currentWord}`, {
- "headers": {
- "content-type": "application/json;charset=UTF-8",
- },
- "mode": "cors",
- "credentials": "include"
- });
- if ((await res.json()).isAvailable) {
- console.log(`Conta Disponível: ${currentWord}`);
- } else {
- // Ação a ser tomada caso o nick não esteja disponível
- }
- }
- tryName(); // continua verificando os nicks
- }
- tryName();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement