Skip to content

Commit

Permalink
imcreased chances to get code
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamyplayer authored Jun 22, 2021
1 parent 97a3f80 commit 277a971
Showing 1 changed file with 99 additions and 55 deletions.
154 changes: 99 additions & 55 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,106 @@
const { chalk, fetch, clutter, makeid, E, Webhook } = require('./Global');
const {
chalk,
fetch,
E,
Webhook,
RAN_GEN_1,
RAN_GEN_2,
RAN_GEN_3,
RAN_GEN_4,
RAN_GEN_Direct,
RAN_GEN_Shuff,
RAN_GEN_TOP,
Welcome,
} = require('./Global');

console.log(Welcome);

// NOTE: DON'T TRY TO DECREASE TIME
// THIS IS MINIMUM.
setTimeout(() => {
let num = 1;

let num = 1;

(async function Loop() {
let codes = clutter(makeid(24));
const url = `https://discordapp.com/api/v6/entitlements/gift-codes/${codes}?with_application=false&with_subscription_plan=true`;

fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
})
.then(res => {
if (res.status === 429) {
process.exit(0);
} else if (res.status === 200) {
console.log(`🎉 Found Working Discord Nitro 🎉 \nhttps://discord.gift/${codes}`);

const WEBHOOK_URL = undefined;
if (WEBHOOK_URL === undefined) return;

const hook = new Webhook(WEBHOOK_URL);
const IMAGE_URL =
'https://cdn.discordapp.com/attachments/851533693657808926/856145091688136714/ezgif.com-gif-maker_5.png';

hook.setUsername('Discord Nitro Gen');
hook.setAvatar(IMAGE_URL);

hook.send(`🎉 Found Working Discord Nitro 🎉 \nhttps://discord.gift/${codes}`);
} else {
let x = 0;

console.log(`\n${chalk.green('Testing')} ${chalk.magenta(num)}`);
console.log(` ❌ ${chalk.green(res.ok)} || ${res.status} || ${chalk.blue(res.statusText)}\n`);

const loader = setInterval(() => {
process.stdout.write(`\r${E[x++]} Checking - ${chalk.yellow(codes)}`);
x %= E.length;
}, 550);

setTimeout(() => {
clearInterval(loader);
}, 20000);
}
(async function Loop() {
let nitro_codes = [
RAN_GEN_1(24),
RAN_GEN_2(24),
RAN_GEN_3(24),
RAN_GEN_4,
RAN_GEN_Direct,
RAN_GEN_TOP(24),
RAN_GEN_Shuff(RAN_GEN_1(24)),
RAN_GEN_Shuff(RAN_GEN_2(24)),
RAN_GEN_Shuff(RAN_GEN_3(24)),
RAN_GEN_Shuff(RAN_GEN_TOP(24)),
];

let codes = nitro_codes[Math.floor(Math.random() * nitro_codes.length)];
const url = `https://discordapp.com/api/v6/entitlements/gift-codes/${codes}?with_application=false&with_subscription_plan=true`;

await fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
})
.catch(console.error);
.then(res => {
if (res.status === 429) {
process.exit(0);
} else if (res.status === 200) {
console.log(`🎉 Found Working Discord Nitro 🎉 \nhttps://discord.gift/${codes}`);

const WEBHOOK_URL = undefined;
if (WEBHOOK_URL === undefined) return;

const hook = new Webhook(WEBHOOK_URL);
const IMAGE_URL =
'https://cdn.discordapp.com/attachments/851533693657808926/856145091688136714/ezgif.com-gif-maker_5.png';

hook.setUsername('Discord Nitro Gen');
hook.setAvatar(IMAGE_URL);

hook.send(`🎉 Found Working Discord Nitro 🎉 \nhttps://discord.gift/${codes}`);
} else {
let x = 0;

console.log(`\n${chalk.green('Testing')} ${chalk.magenta(num)}`);
console.log(` ❌ ${chalk.green(res.ok)} || ${res.status} || ${chalk.blue(res.statusText)}\n`);

setTimeout(async () => {
num++;
if (num < 5000) {
await Loop();
}
}, 20000);
})();
const loader = setInterval(() => {
process.stdout.write(`\r${E[x++]} Checking - ${chalk.yellow(codes)}`);
x %= E.length;
}, 550);

console.log(chalk.blue.bold(`Press ${chalk.red('Cntrl + c')} to exit Script.`));
setTimeout(() => {
clearInterval(loader);
}, 25000);
}
})
.catch(console.error);

setTimeout(async () => {
num++;
if (num < 10000) {
await Loop();
}
}, 25000);
})();
}, 15000);

setTimeout(() => {
console.log(
chalk.blue.bold(
`Press ${chalk.red('Cntrl + c')} to exit Script.\n\n${chalk.magenta('Testing will start in 15 seconds\n')}`,
),
);
}, 3000);

setTimeout(() => {
console.log(
`${chalk.yellow('⚠️ NOTE:')} If you haven't added WEBHOOK_URL, you won't be notified for Valid Nitro codes
you should always keep an eye on Terminal/console for valid Nitro codes`,
);
}, 6000);

// Checking Memeory Status
setInterval(() => {
Expand All @@ -67,6 +109,8 @@ setInterval(() => {

const used = process.memoryUsage().heapUsed / 4096 / 4096;
console.log(
`${chalk.bold.cyan(`\n🐏 This Script uses approxiamately ${Math.round(used * 100) / 100} MB / 4GB RAM`)}`,
`${chalk.bold.cyan(
`\n🐏 This Script uses approxiamately ${chalk.blue(Math.round(used * 100) / 100)} MB / 4GB RAM`,
)}`,
);
}, 600000);

0 comments on commit 277a971

Please sign in to comment.