wsnipz 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/prompts.js CHANGED
@@ -36,6 +36,9 @@ exports.PROXY_FORMAT_LINES = [
36
36
  chalk_1.default.gray(' ip:port:user:pass -> http by default'),
37
37
  ];
38
38
  async function mainMenu(config, save) {
39
+ if (!config.token && !config.proxy) {
40
+ await onboarding(config, save);
41
+ }
39
42
  while (true) {
40
43
  const { choice } = await inquirer_1.default.prompt({
41
44
  type: 'list',
@@ -62,6 +65,51 @@ async function mainMenu(config, save) {
62
65
  }
63
66
  }
64
67
  }
68
+ async function onboarding(config, save) {
69
+ const { hasProxies } = await inquirer_1.default.prompt({
70
+ type: 'confirm',
71
+ name: 'hasProxies',
72
+ message: 'Do you have proxies to use?',
73
+ default: false,
74
+ });
75
+ if (hasProxies) {
76
+ const pool = await loadProxyFile(config);
77
+ if (pool.size === 0) {
78
+ console.log(chalk_1.default.red(' No valid proxies found in the file.'));
79
+ }
80
+ console.log(chalk_1.default.green(` ${pool.size} proxy(s) loaded.`));
81
+ }
82
+ const { token } = await inquirer_1.default.prompt({
83
+ type: 'password',
84
+ name: 'token',
85
+ mask: '*',
86
+ message: 'Discord user token (NOT a bot token) — required even with proxies:',
87
+ validate: (v) => (v && v.length > 10 ? true : 'Invalid token'),
88
+ });
89
+ config.token = token;
90
+ save(config);
91
+ console.log(chalk_1.default.green('\n Setup complete!'));
92
+ console.log(chalk_1.default.gray(' You can change these anytime in Settings.\n'));
93
+ }
94
+ async function loadProxyFile(config) {
95
+ console.log(chalk_1.default.gray(' Format: http://ip:port | http://user:pass@ip:port | socks5://ip:port | ip:port'));
96
+ const { file } = await inquirer_1.default.prompt({
97
+ type: 'input',
98
+ name: 'file',
99
+ message: 'Path to the proxy .txt file:',
100
+ default: 'proxies.txt',
101
+ validate: (v) => v && fs_1.default.existsSync(v) ? true : 'File not found',
102
+ });
103
+ const { rotating } = await inquirer_1.default.prompt({
104
+ type: 'confirm',
105
+ name: 'rotating',
106
+ message: 'Are your proxies rotating (the provider changes the IP automatically)?',
107
+ default: true,
108
+ });
109
+ const pool = proxies_1.ProxyPool.loadFromFile(file, rotating);
110
+ config.proxy = { file, rotating, loaded: pool.list };
111
+ return pool;
112
+ }
65
113
  async function ensureProxyPool(config) {
66
114
  const choices = [];
67
115
  if (config.proxy && config.proxy.file && fs_1.default.existsSync(config.proxy.file)) {
@@ -80,32 +128,16 @@ async function ensureProxyPool(config) {
80
128
  choices,
81
129
  });
82
130
  if (mode === 'direct') {
83
- console.log(chalk_1.default.yellow(' Direct connection selected (not recommended for mass scanning).'));
131
+ console.log(chalk_1.default.yellow(' No proxy selected. Checks will run on your own IP (risky).'));
84
132
  return null;
85
133
  }
86
134
  if (mode === 'saved') {
87
135
  return proxies_1.ProxyPool.loadFromFile(config.proxy.file, config.proxy.rotating);
88
136
  }
89
- console.log((0, ui_1.box)('Proxy format', exports.PROXY_FORMAT_LINES));
90
- console.log();
91
- const { file } = await inquirer_1.default.prompt({
92
- type: 'input',
93
- name: 'file',
94
- message: 'Path to the proxy .txt file:',
95
- default: 'proxies.txt',
96
- validate: (v) => v && fs_1.default.existsSync(v) ? true : 'File not found',
97
- });
98
- const { rotating } = await inquirer_1.default.prompt({
99
- type: 'confirm',
100
- name: 'rotating',
101
- message: 'Are your proxies rotating (the provider changes the IP automatically)?',
102
- default: true,
103
- });
104
- const pool = proxies_1.ProxyPool.loadFromFile(file, rotating);
137
+ const pool = await loadProxyFile(config);
105
138
  if (pool.size === 0) {
106
139
  console.log(chalk_1.default.red(' No valid proxies found in the file.'));
107
140
  }
108
- config.proxy = { file, rotating, loaded: pool.list };
109
141
  console.log(chalk_1.default.green(` ${pool.size} proxy(s) loaded.`));
110
142
  return pool;
111
143
  }
@@ -124,7 +156,7 @@ async function ensureToken(config, save) {
124
156
  type: 'password',
125
157
  name: 'token',
126
158
  mask: '*',
127
- message: 'Discord token:',
159
+ message: 'Discord user token (NOT a bot token):',
128
160
  validate: (v) => (v && v.length > 10 ? true : 'Invalid token'),
129
161
  });
130
162
  config.token = token;
@@ -245,7 +277,7 @@ async function configureSettings(config, save) {
245
277
  type: 'password',
246
278
  name: 'token',
247
279
  mask: '*',
248
- message: 'Discord token:',
280
+ message: 'Discord user token (NOT a bot token):',
249
281
  validate: (v) => (v && v.length > 10 ? true : 'Invalid token'),
250
282
  });
251
283
  config.token = token;
package/dist/proxies.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ProxyPool = void 0;
7
7
  exports.normalizeProxyUrl = normalizeProxyUrl;
8
8
  const fs_1 = __importDefault(require("fs"));
9
- const { ProxyAgent } = require('proxy-agent');
9
+ const ProxyAgent = require('proxy-agent');
10
10
  function normalizeProxyUrl(raw) {
11
11
  let s = raw.trim();
12
12
  if (!s)
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = exports.PACKAGE_NAME = void 0;
4
4
  exports.PACKAGE_NAME = 'wsnipz';
5
- exports.VERSION = '1.1.0';
5
+ exports.VERSION = '1.2.1';
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "wsnipz", "version": "1.1.0", "description": "A modern Discord username availability checker CLI with rotating proxy support.", "main": "dist/index.js", "bin": {"wsniper": "dist/index.js", "wsnipz": "dist/index.js"}, "files": ["dist"], "scripts": {"build": "tsc", "dev": "ts-node src/index.ts", "start": "node dist/index.js", "prepublishOnly": "npm run build"}, "keywords": ["discord", "username", "checker", "sniper", "cli", "proxy", "availability", "wsnipz"], "author": "", "license": "MIT", "engines": {"node": ">=16"}, "dependencies": {"axios": "^1.7.7", "chalk": "^4.1.2", "cli-table3": "^0.6.5", "commander": "^11.1.0", "figlet": "^1.8.0", "inquirer": "^8.2.6", "ora": "^5.4.1", "proxy-agent": "^5.0.0"}, "devDependencies": {"@types/figlet": "^1.7.0", "@types/inquirer": "^8.2.10", "@types/node": "^20.16.0", "ts-node": "^10.9.2", "typescript": "^5.6.0"}}
1
+ {"name": "wsnipz", "version": "1.2.1", "description": "A modern Discord username availability checker CLI with rotating proxy support.", "main": "dist/index.js", "bin": {"wsniper": "dist/index.js", "wsnipz": "dist/index.js"}, "files": ["dist"], "scripts": {"build": "tsc", "dev": "ts-node src/index.ts", "start": "node dist/index.js", "prepublishOnly": "npm run build"}, "keywords": ["discord", "username", "checker", "sniper", "cli", "proxy", "availability", "wsnipz"], "author": "", "license": "MIT", "engines": {"node": ">=16"}, "dependencies": {"axios": "^1.7.7", "chalk": "^4.1.2", "cli-table3": "^0.6.5", "commander": "^11.1.0", "figlet": "^1.8.0", "inquirer": "^8.2.6", "ora": "^5.4.1", "proxy-agent": "^5.0.0"}, "devDependencies": {"@types/figlet": "^1.7.0", "@types/inquirer": "^8.2.10", "@types/node": "^20.16.0", "ts-node": "^10.9.2", "typescript": "^5.6.0"}}