Skip to content

Commit

Permalink
add classic nitro
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamyplayer committed Jul 1, 2021
1 parent b31dc4b commit a048997
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 86 deletions.
155 changes: 92 additions & 63 deletions src/Global.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/* eslint-disable no-irregular-whitespace */
const RandExp = require('randexp');
const fetch = require('node-fetch');
const chalk = require('chalk');
const { Webhook } = require('discord-webhook-node');
const RandExp = require("randexp");
const fetch = require("node-fetch");
const chalk = require("chalk");
const { Webhook } = require("discord-webhook-node");

const RAN_GEN_TOP = length => {
const RAN_GEN_TOP = (length) => {
if (!length) {
return '';
return "";
}

const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789×_-';
const possible =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789×_-";
// added 2 additional characters (possibly - and _) to the charset.
let array;

if ('Uint8Array' in this && 'crypto' in this && length <= 65536) {
if ("Uint8Array" in this && "crypto" in this && length <= 65536) {
array = new Uint8Array(length);
this.crypto.getRandomValues(array);
} else {
Expand All @@ -24,7 +25,7 @@ const RAN_GEN_TOP = length => {
}
}

let result = '';
let result = "";

for (let i = 0; i < length; i++) {
result += possible.charAt(array[i] % 62);
Expand All @@ -33,24 +34,29 @@ const RAN_GEN_TOP = length => {
return result;
};

const RAN_GEN_1 = length => {
let txt = '';
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789×';
const RAN_GEN_1 = (length) => {
let txt = "";
const possible =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789×";

for (let i = 0; i < length; i++) txt += possible.charAt(Math.floor(Math.random() * possible.length));
for (let i = 0; i < length; i++)
txt += possible.charAt(Math.floor(Math.random() * possible.length));

return txt;
};

const RAN_GEN_2 = (n, r = '') => {
while (n--) r += String.fromCharCode(((r = (Math.random() * 62) | 0), (r += r > 9 ? (r < 36 ? 55 : 61) : 48)));
const RAN_GEN_2 = (n, r = "") => {
while (n--)
r += String.fromCharCode(
((r = (Math.random() * 62) | 0), (r += r > 9 ? (r < 36 ? 55 : 61) : 48))
);
return r;
};

const RAN_GEN_Shuff = v => [...v].sort(_ => Math.random() - 0.5).join('');
const RAN_GEN_Shuff = (v) => [...v].sort((_) => Math.random() - 0.5).join("");

const RAN_GEN_3 = len => {
let str = '';
const RAN_GEN_3 = (len) => {
let str = "";
for (let i = 0; i < len; i++) {
let rand = Math.floor(Math.random() * 62);
let charCode = (rand += rand > 9 ? (rand < 36 ? 55 : 61) : 48);
Expand All @@ -60,65 +66,85 @@ const RAN_GEN_3 = len => {
};

const RAN_GEN_Direct = new Array(24).join().replace(/(.|$)/g, function () {
return ((Math.random() * 36) | 0).toString(36)[Math.random() < 0.5 ? 'toString' : 'toUpperCase']();
return ((Math.random() * 36) | 0)
.toString(36)
[Math.random() < 0.5 ? "toString" : "toUpperCase"]();
});

const possible = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789×';
const RAN_GEN_4 = [...Array(24)].map(_ => possible[~~(Math.random() * possible.length)]).join('');
const RAN_GEN_Direct_C = new Array(16).join().replace(/(.|$)/g, function () {
return ((Math.random() * 36) | 0)
.toString(36)
[Math.random() < 0.5 ? "toString" : "toUpperCase"]();
});

const possible =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789×";
const RAN_GEN_4 = [...Array(24)]
.map((_) => possible[~~(Math.random() * possible.length)])
.join("");

const RAN_GEN_4_C = [...Array(16)]
.map((_) => possible[~~(Math.random() * possible.length)])
.join("");

const RAN_REGEX = new RandExp(/^[0-9,a-z,A-Z]{24}$/).gen();

const RAN_REGEX_C = new RandExp(/^[0-9,a-z,A-Z]{24}$/).gen();

let E = [
'🥳',
'⚡',
'🔨',
'💘',
'🔥',
'🚀',
'🎉',
'🍰',
'🎃',
'🍔',
'🍺',
'🍼',
'🌹',
'🧐',
'🤪',
'🌀',
'🌁',
'😋',
'😌',
'😍',
'😎',
'😏',
'🌈',
'🌊',
'🌛',
'🌝',
'🌞',
'🌟',
'🌠',
'🌡️',
'🌤️',
'🌩️',
'🌪️',
'🌬️',
'🌭',
'🌮',
'🌯',
'🍑',
'🌰',
"🥳",
"⚡",
"🔨",
"💘",
"🔥",
"🚀",
"🎉",
"🍰",
"🎃",
"🍔",
"🍺",
"🍼",
"🌹",
"🧐",
"🤪",
"🌀",
"🌁",
"😋",
"😌",
"😍",
"😎",
"😏",
"🌈",
"🌊",
"🌛",
"🌝",
"🌞",
"🌟",
"🌠",
"🌡️",
"🌤️",
"🌩️",
"🌪️",
"🌬️",
"🌭",
"🌮",
"🌯",
"🍑",
"🌰",
];

let Welcome_txt = ` 🇼​​​​​ 🇪​​​​​ 🇱 ​​​​​🇨​ ​​​​🇴​​​​​ 🇲​​​​​ 🇪
🇹​​​​​ 🇴
🇩​​​​​ 🇮​​​​​ 🇸​​​​​ 🇨 ​​​​​🇴​​​​​ 🇷​​​​​ 🇩​​​​​ 🇳​​​​​ 🇮​​​​​ 🇹 ​​​​​🇷​​​​​ 🇴
🇬​​​​​ 🇪​​​​​ 🇳​​​​​ 🇪​​​​​ 🇷​​​​​ 🇦​​​​​ 🇹​​​​​ 🇴​ 🇷\n\n`;

let Credit_txt = `Made by ${chalk.blue('♔ Dяεαмү アlαүεя ♔')} With ❤️\n\n`;
let Discord = `Need help? ${chalk.hex('#5865F2').bold('Join Our Discord')} \n${chalk.blue.bold(
'https://discord.gg/CNAJfbs5dn\n\n',
let Credit_txt = `Made by ${chalk.blue("♔ Dяεαмү アlαүεя ♔")} With ❤️\n\n`;
let Discord = `Need help? ${chalk
.hex("#5865F2")
.bold("Join Our Discord")} \n${chalk.blue.bold(
"https://discord.gg/CNAJfbs5dn\n\n"
)}`;

let Welcome = Welcome_txt + Credit_txt + Discord;

module.exports = {
Expand All @@ -132,6 +158,9 @@ module.exports = {
RAN_GEN_Direct,
RAN_GEN_Shuff,
RAN_REGEX,
RAN_GEN_4_C,
RAN_REGEX_C,
RAN_GEN_Direct_C,
E,
Webhook,
Welcome,
Expand Down
85 changes: 62 additions & 23 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ const {
RAN_REGEX,
RAN_GEN_TOP,
Welcome,
} = require('./Global');
const { WEBHOOK_URL } = require('./config');
RAN_GEN_4_C,
RAN_GEN_Direct_C,
RAN_REGEX_C,
} = require("./Global");
const { WEBHOOK_URL } = require("./config");

console.log(Welcome);

Expand All @@ -23,7 +26,7 @@ setTimeout(() => {
let num = 1;

(async function Loop() {
let nitro_codes = [
let nitro_premium = [
RAN_GEN_1(24),
RAN_GEN_2(24),
RAN_GEN_3(24),
Expand All @@ -37,38 +40,68 @@ setTimeout(() => {
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`;
let nitro_classic = [
RAN_GEN_1(16),
RAN_GEN_2(16),
RAN_GEN_3(16),
RAN_GEN_4_C,
RAN_GEN_Direct_C,
RAN_REGEX_C,
RAN_GEN_TOP(16),
RAN_GEN_Shuff(RAN_GEN_1(16)),
RAN_GEN_Shuff(RAN_GEN_2(16)),
RAN_GEN_Shuff(RAN_GEN_3(16)),
RAN_GEN_Shuff(RAN_GEN_TOP(16)),
];

let classic =
nitro_classic[Math.floor(Math.random() * nitro_classic.length)];
let premium = nitro_premium[Math.floor(Math.random() * nitro_premium.length)];
let final = [classic, premium];
let codes = final[Math.floor(Math.random() * final.length)];

const url = `https://discord.com/api/v9/entitlements/gift-codes/${codes}?with_application=false&with_subscription_plan=true`;

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

if (WEBHOOK_URL === '') return;
if (WEBHOOK_URL === "") return;

const hook = new Webhook(WEBHOOK_URL);
const IMAGE_URL = 'https://discord.com/assets/b941bc1dfe379db6cc1f2acc5a612f41.png';
const IMAGE_URL =
"https://discord.com/assets/b941bc1dfe379db6cc1f2acc5a612f41.png";

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

hook.send(`🎉 Found Working Discord Nitro 🎉 \nhttps://discord.gift/${codes}`);
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`);
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)}`);
process.stdout.write(
`\r${E[x++]} Checking - ${chalk.yellow(codes)}`
);
x %= E.length;
}, 550);

Expand All @@ -91,16 +124,20 @@ setTimeout(() => {
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')}`,
),
`Press ${chalk.red("Cntrl + c")} to exit Script.\n\n${chalk.magenta(
"Testing will start in 15 seconds\n"
)}`
)
);
}, 3000);

setTimeout(() => {
if (WEBHOOK_URL === '') {
if (WEBHOOK_URL === "") {
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`,
`${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);
Expand All @@ -113,7 +150,9 @@ setInterval(() => {
const used = process.memoryUsage().heapUsed / 4096 / 4096;
console.log(
`${chalk.bold.cyan(
`\n🐏 This Script uses approxiamately ${chalk.blue(Math.round(used * 100) / 100)} MB / 4GB RAM`,
)}`,
`\n🐏 This Script uses approxiamately ${chalk.blue(
Math.round(used * 100) / 100
)} MB / 4GB RAM`
)}`
);
}, 600000);

0 comments on commit a048997

Please sign in to comment.