Skip to content

Commit

Permalink
Initial Release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamyplayer committed Jun 19, 2021
0 parents commit 363efdf
Show file tree
Hide file tree
Showing 7 changed files with 378 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": ["strongloop", "plugin:prettier/recommended"],
"plugins": ["import"],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module" // add this
},
"rules": {
"max-len": [2, 160, 8],
"prettier/prettier": "error"
},
"env": {
"es2020": true,
"node": true
}

}
55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# test
test.js

# yarn
yarn.lock

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Misc
.jsdoc.json
150 changes: 150 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all",
"endOfLine": "lf",
"arrowParens": "avoid",
"strict": ["error", "global"],
"no-await-in-loop": "warn",
"no-compare-neg-zero": "error",
"no-template-curly-in-string": "error",
"no-unsafe-negation": "error",
"valid-jsdoc": [
"error",
{
"requireReturn": false,
"requireReturnDescription": false,
"prefer": {
"return": "returns",
"arg": "param"
},
"preferType": {
"String": "string",
"Number": "number",
"Boolean": "boolean",
"Symbol": "symbol",
"object": "Object",
"function": "Function",
"array": "Array",
"date": "Date",
"error": "Error",
"null": "void"
}
}
],

"accessor-pairs": "warn",
"array-callback-return": "error",
"consistent-return": "error",
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"dot-notation": "error",
"eqeqeq": "error",
"no-empty-function": "error",
"no-floating-decimal": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-lone-blocks": "error",
"no-multi-spaces": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-new": "error",
"no-octal-escape": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-escape": "error",
"no-useless-return": "error",
"no-void": "error",
"no-warning-comments": "warn",
"prefer-promise-reject-errors": "error",
"require-await": "warn",
"wrap-iife": "error",
"yoda": "error",

"no-label-var": "error",
"no-shadow": "error",
"no-undef-init": "error",

"callback-return": "error",
"getter-return": "off",
"handle-callback-err": "error",
"no-mixed-requires": "error",
"no-new-require": "error",
"no-path-concat": "error",

"array-bracket-spacing": "error",
"block-spacing": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"capitalized-comments": ["error", "always", { "ignoreConsecutiveComments": true }],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": "error",
"consistent-this": ["error", "$this"],
"eol-last": "error",
"func-names": "error",
"func-name-matching": "error",
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"key-spacing": "error",
"keyword-spacing": "error",
"max-depth": "error",
"max-len": ["error", 120, 2],
"max-nested-callbacks": ["error", { "max": 4 }],
"max-statements-per-line": ["error", { "max": 2 }],
"new-cap": "off",
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }],
"no-array-constructor": "error",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
"no-new-object": "error",
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": "error",
"object-curly-spacing": ["error", "always"],
"operator-assignment": "error",
"padded-blocks": ["error", "never"],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"semi-spacing": "error",
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}
],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"template-tag-spacing": "error",
"unicode-bom": "error",

"arrow-body-style": "error",
"arrow-parens": ["error", "as-needed"],
"arrow-spacing": "error",
"no-duplicate-imports": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"prefer-arrow-callback": "error",
"prefer-numeric-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"rest-spread-spacing": "error",
"template-curly-spacing": "error",
"yield-star-spacing": "error"

}
Empty file added README.md
Empty file.
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "dreamy",
"version": "1.0.0",
"description": "Nitro Generator and checker.",
"main": "src/app.js",
"author": "♔ Dяεαмү アlαүεя ♔",
"license": "MIT",
"private": true,
"scripts": {
"start": "node src/app.js",
"test": "eslint --fix --ignore-path .gitignore ."
},
"devDependencies": {
"chalk": "^4.1.1",
"eslint": "^7.28.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-strongloop": "^2.1.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"prettier": "^2.3.1"
},
"dependencies": {
"discord-webhook-node": "^1.1.8",
"node-fetch": "^2.6.1"
}
}
61 changes: 61 additions & 0 deletions src/Global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const readline = require('readline');
const fetch = require('node-fetch');
const chalk = require('chalk');
const { Webhook } = require('discord-webhook-node');

function makeid(length) {
let text = '';
let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789×';

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

return text;
}

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

let E = [
'🥳',
'⚡',
'🔨',
'💘',
'🚀',
'🔥',
'🎉',
'🍰',
'🎃',
'🎏',
'⛄',
'🌹',
'🧐',
'🤪',
'🌀',
'🌁',
'🌂',
'🌃',
'🌄',
'🌅',
'🌆',
'🌇',
'🌈',
'🌉',
'🌊',
'🌋',
'🌌',
'🌛',
'🌝',
'🌞',
'🌟',
'🌠',
'🌡️',
'🌤️',
'🌩️',
'🌪️',
'🌬️',
'🌭',
'🌮',
'🌯',
'🌰',
];

module.exports = { readline, fetch, chalk, makeid, clutter, E, Webhook };
69 changes: 69 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const { chalk, fetch, clutter, makeid, E, Webhook } = require('./Global');

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.ok === 429) {
process.exit(0);
} else if (res.ok === 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/855850972830760960/EGS_Discord_Nitro.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;
}, 750);

setTimeout(() => {
clearInterval(loader);
}, 30000);
}
})
.catch(console.error);

setTimeout(async () => {
num++;
if (num < 5000) {
await Loop();
}
}, 30000);
})();

console.log(chalk.blue.bold(`Press ${chalk.red('Cntrl + c')} to exit Script.`));

// Checking Memeory Status
setInterval(() => {
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
arr.reverse();

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`)}`,
);
}, 600000); // 10 min

0 comments on commit 363efdf

Please sign in to comment.