Compare commits

...

3 Commits

7 changed files with 565 additions and 57 deletions

@ -8,8 +8,14 @@ let deletedMessages = new Set();
const CACHE_CLEANUP_INTERVAL = 30 * 60 * 1000;
const DELETION_DELAY = 5 * 60 * 1000;
const MIN_DELETE_INTERVAL = 2500;
const MAX_DELETE_INTERVAL = 3500;
let DELETE_INTERVAL_MIN = 8000;
let DELETE_INTERVAL_MAX = 15000;
let JITTER_FACTOR = 0.4;
let PAUSE_CHANCE = 0.15;
let PAUSE_LENGTH_MIN = 30000;
let PAUSE_LENGTH_MAX = 120000;
let BATCH_SIZE = 3;
let currentBatchCount = 0;
setInterval(() => {
if (deletedMessages.size > 1000) {
@ -18,8 +24,28 @@ setInterval(() => {
}
}, CACHE_CLEANUP_INTERVAL);
const getRandomInterval = () => {
return Math.floor(Math.random() * (MAX_DELETE_INTERVAL - MIN_DELETE_INTERVAL)) + MIN_DELETE_INTERVAL;
const getHumanlikeDelay = () => {
const baseInterval = Math.floor(Math.random() * (DELETE_INTERVAL_MAX - DELETE_INTERVAL_MIN + 1)) + DELETE_INTERVAL_MIN;
const jitterAmount = baseInterval * JITTER_FACTOR;
const jitter = Math.random() * jitterAmount * 2 - jitterAmount;
return Math.max(1000, Math.floor(baseInterval + jitter));
};
const shouldTakePause = () => {
currentBatchCount++;
if (currentBatchCount >= BATCH_SIZE) {
currentBatchCount = 0;
return Math.random() < PAUSE_CHANCE;
}
return false;
};
const getPauseDuration = () => {
return Math.floor(Math.random() * (PAUSE_LENGTH_MAX - PAUSE_LENGTH_MIN + 1)) + PAUSE_LENGTH_MIN;
};
const processDeleteQueue = async () => {
@ -33,30 +59,26 @@ const processDeleteQueue = async () => {
console.log(`[AUTODELETE] Message ${messageToDelete.id} already deleted (cached), skipping`);
if (deleteQueue.length > 0 && isProcessingQueue) {
const nextInterval = getRandomInterval();
console.log(`[AUTODELETE] Next deletion in ${nextInterval}ms | Queue size: ${deleteQueue.length}`);
setTimeout(processDeleteQueue, nextInterval);
scheduleNextDeletion();
} else {
isProcessingQueue = false;
}
return;
}
const deleteDelay = Math.floor(Math.random() * 100) + 50;
await new Promise(resolve => setTimeout(resolve, deleteDelay));
console.log(`[AUTODELETE] Waited ${deleteDelay}ms before processing`);
const preDeleteDelay = Math.floor(Math.random() * 1500) + 500; // 500-2000ms
await new Promise(resolve => setTimeout(resolve, preDeleteDelay));
if (isFirstDeletion || Math.random() < 0.2) {
if (isFirstDeletion || Math.random() < 0.35) {
console.log(`[AUTODELETE] Checking message ${messageToDelete.id} existence${isFirstDeletion ? ' (first deletion)' : ''}`);
const exists = await messageToDelete.fetch().catch(() => null);
if (!exists) {
console.log(`[AUTODELETE] Message ${messageToDelete.id} no longer exists, adding to cache`);
deletedMessages.add(messageToDelete.id);
isFirstDeletion = false;
if (deleteQueue.length > 0 && isProcessingQueue) {
const nextInterval = getRandomInterval();
console.log(`[AUTODELETE] Next deletion in ${nextInterval}ms | Queue size: ${deleteQueue.length}`);
setTimeout(processDeleteQueue, nextInterval);
scheduleNextDeletion();
} else {
isProcessingQueue = false;
}
@ -64,10 +86,24 @@ const processDeleteQueue = async () => {
}
}
if (Math.random() < 0.25) {
const readingDelay = Math.floor(Math.random() * 3000) + 1000; // 1-4 seconds "reading" delay
console.log(`[AUTODELETE] Taking ${readingDelay}ms to "read" before deleting`);
await new Promise(resolve => setTimeout(resolve, readingDelay));
}
await messageToDelete.delete().catch((error) => {
if (error.code === 10008) {
console.log(`[AUTODELETE] Message ${messageToDelete.id} already deleted, adding to cache`);
deletedMessages.add(messageToDelete.id);
} else if (error.code === 429) {
console.log(`[AUTODELETE] Rate limited when deleting ${messageToDelete.id}. Will retry later.`);
deleteQueue.push(messageToDelete);
DELETE_INTERVAL_MIN = Math.min(DELETE_INTERVAL_MIN * 1.5, 25000);
DELETE_INTERVAL_MAX = Math.min(DELETE_INTERVAL_MAX * 1.5, 45000);
console.log(`[AUTODELETE] Increased deletion intervals to ${DELETE_INTERVAL_MIN}-${DELETE_INTERVAL_MAX}ms`);
} else {
console.log(`[AUTODELETE] Couldn't delete message ${messageToDelete.id}:`, error);
}
@ -75,8 +111,14 @@ const processDeleteQueue = async () => {
if (!deletedMessages.has(messageToDelete.id)) {
deletedMessages.add(messageToDelete.id);
console.log(`[AUTODELETE] Processed and cached message ${messageToDelete.id}`);
console.log(`[AUTODELETE] Successfully deleted message ${messageToDelete.id}`);
if (Math.random() < 0.1) {
DELETE_INTERVAL_MIN = Math.max(DELETE_INTERVAL_MIN * 0.95, 8000);
DELETE_INTERVAL_MAX = Math.max(DELETE_INTERVAL_MAX * 0.95, 15000);
}
}
isFirstDeletion = false;
} catch (error) {
@ -84,17 +126,36 @@ const processDeleteQueue = async () => {
}
if (deleteQueue.length > 0 && isProcessingQueue) {
const nextInterval = getRandomInterval();
console.log(`[AUTODELETE] Next deletion in ${nextInterval}ms | Queue size: ${deleteQueue.length}`);
setTimeout(processDeleteQueue, nextInterval);
scheduleNextDeletion();
} else {
isProcessingQueue = false;
}
};
const scheduleNextDeletion = () => {
if (shouldTakePause()) {
const pauseDuration = getPauseDuration();
console.log(`[AUTODELETE] Taking a break for ${Math.round(pauseDuration / 1000)} seconds before continuing deletion. Queue size: ${deleteQueue.length}`);
setTimeout(processDeleteQueue, pauseDuration);
} else {
let nextInterval = getHumanlikeDelay();
if (deleteQueue.length > 15) {
nextInterval = Math.max(Math.floor(nextInterval * 0.8), 5000);
}
else if (deleteQueue.length <= 2) {
nextInterval = Math.floor(nextInterval * 1.2);
}
console.log(`[AUTODELETE] Next deletion in ${nextInterval}ms | Queue size: ${deleteQueue.length}`);
setTimeout(processDeleteQueue, nextInterval);
}
};
const startQueueProcessing = () => {
if (!isProcessingQueue && deleteQueue.length > 0) {
isProcessingQueue = true;
currentBatchCount = 0;
processDeleteQueue();
}
};
@ -108,29 +169,32 @@ const handleNewMessage = (message) => {
}
if (message.content.startsWith('.autodelete')) {
console.log(`[AUTODELETE] Skipping command message: ${message.id}`);
ignoredMessages.add(message.id);
return;
}
console.log(`[AUTODELETE] New message tracked: ${message.id}`);
console.log(`[AUTODELETE] Content preview: ${message.content.slice(0, 30)}...`);
const variableDelay = DELETION_DELAY + (Math.random() * 60000) - 30000; // +/- 30 seconds
const timer = setTimeout(() => {
if (isAutoDeleteActive) {
console.log(`[AUTODELETE] Timer completed for message: ${message.id}`);
console.log(`[AUTODELETE] Timer completed for message: ${message.id} after ~${Math.round(variableDelay / 1000 / 60)} minutes`);
if (!deletedMessages.has(message.id)) {
deleteQueue.push(message);
messageTimers.delete(message.id);
startQueueProcessing();
}
}
}, DELETION_DELAY);
}, variableDelay);
messageTimers.set(message.id, timer);
};
module.exports = {
name: 'autodelete',
description: 'Automatically deletes your messages after 5 minutes',
description: 'Automatically deletes your messages after a set time',
async execute(message, args, deleteTimeout) {
ignoredMessages.add(message.id);
@ -147,25 +211,80 @@ module.exports = {
isProcessingQueue = false;
isFirstDeletion = true;
DELETE_INTERVAL_MIN = 8000;
DELETE_INTERVAL_MAX = 15000;
currentBatchCount = 0;
console.log('[AUTODELETE] System deactivated - All timers cleared');
message.channel.send('Auto-delete has been deactivated.')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
}
if (args[0]?.toLowerCase() === 'delay' && args[1]) {
const newDelay = parseInt(args[1], 10);
if (!isNaN(newDelay) && newDelay >= 1) {
const oldDelay = Math.round(DELETION_DELAY / 1000 / 60);
DELETION_DELAY = newDelay * 1000 * 60;
message.channel.send(`Auto-delete delay changed from ${oldDelay} to ${newDelay} minutes.`)
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
} else {
message.channel.send('Please provide a valid delay in minutes (minimum 1 minute).')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
}
}
if (args[0]?.toLowerCase() === 'speed') {
if (args[1]?.toLowerCase() === 'slow') {
DELETE_INTERVAL_MIN = 15000;
DELETE_INTERVAL_MAX = 30000;
PAUSE_CHANCE = 0.25;
message.channel.send('Auto-delete speed set to slow mode (very human-like with frequent pauses).')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
} else if (args[1]?.toLowerCase() === 'medium') {
DELETE_INTERVAL_MIN = 8000;
DELETE_INTERVAL_MAX = 15000;
PAUSE_CHANCE = 0.15;
message.channel.send('Auto-delete speed set to medium mode (balanced human-like behavior).')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
} else if (args[1]?.toLowerCase() === 'fast') {
DELETE_INTERVAL_MIN = 5000;
DELETE_INTERVAL_MAX = 10000;
PAUSE_CHANCE = 0.05;
message.channel.send('Auto-delete speed set to fast mode (less human-like but quicker progress).')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
} else {
message.channel.send('Please specify a valid speed: slow, medium, or fast.')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
}
}
if (!isAutoDeleteActive) {
isAutoDeleteActive = true;
isFirstDeletion = true;
currentBatchCount = 0;
console.log('[AUTODELETE] System activated - Now tracking new messages');
message.client.removeListener('messageCreate', handleNewMessage);
message.client.on('messageCreate', handleNewMessage);
message.channel.send('Auto-delete activated. Each message will be deleted after exactly 5 minutes.')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
const delayInMinutes = Math.round(DELETION_DELAY / 1000 / 60);
message.channel.send(
`Auto-delete activated. Messages will be deleted after ~${delayInMinutes} minutes ` +
`with human-like timing. Use \`.autodelete speed slow/medium/fast\` to adjust deletion speed.`
).then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
} else {
message.channel.send('Auto-delete is already active.')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
const delayInMinutes = Math.round(DELETION_DELAY / 1000 / 60);
message.channel.send(
`Auto-delete is already active. Current delay: ~${delayInMinutes} minutes. ` +
`Use \`.autodelete speed slow/medium/fast\` to adjust deletion speed.`
).then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
}
},
};

@ -11,6 +11,8 @@ module.exports = {
name: 'groupadd',
description: 'Automatically re-adds users to group when they leave. Use multiple IDs for multiple targets.',
async execute(message, args, deleteTimeout) {
const { extractUserId } = require('../utils/userUtils');
if (message.channel.type !== 'GROUP_DM') {
message.channel.send('This command only works in group DMs.')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
@ -29,9 +31,12 @@ module.exports = {
return;
}
const validIds = args.filter(id => /^\d{17,19}$/.test(id));
const validIds = args
.map(arg => extractUserId(arg))
.filter(id => id !== null);
if (validIds.length === 0) {
message.channel.send('Please provide at least one valid user ID.')
message.channel.send('Please provide at least one valid user ID or @mention.')
.then(msg => setTimeout(() => msg.delete().catch(() => { }), deleteTimeout));
return;
}

12
commands/react.js vendored

@ -1,12 +1,14 @@
module.exports = {
name: 'react',
description: `Automatically react with specified emojis to multiple users messages, or stop reacting.`,
description: `Automatically react with specified emojis to multiple users' messages, or stop reacting.`,
async execute(message, args, deleteTimeout) {
const { processUserInput } = require('../utils/userUtils');
if (args.length === 0) {
if (message.client.targetReactUserIds && message.client.reactEmojis) {
const statusMsg = await message.channel.send(
`Currently reacting to messages from the following users: ${message.client.targetReactUserIds
.map(id => `<@${id}>`)
.map(id => `User ID: ${id}`)
.join(', ')} with the following emojis: ${message.client.reactEmojis.join(' ')}.`
);
setTimeout(() => statusMsg.delete().catch(console.error), deleteTimeout);
@ -33,11 +35,11 @@ module.exports = {
return;
}
const targetIds = args[0].split(',').map(id => id.trim());
const targetIds = processUserInput(args[0]);
const emojis = args.slice(1);
if (targetIds.length === 0 || emojis.length === 0) {
const errorMsg = await message.channel.send('Please provide valid user IDs and at least one emoji.');
const errorMsg = await message.channel.send('Please provide valid user IDs or @mentions and at least one emoji.');
setTimeout(() => errorMsg.delete().catch(console.error), deleteTimeout);
return;
}
@ -47,7 +49,7 @@ module.exports = {
const confirmationMsg = await message.channel.send(
`I will now react to messages from the following users: ${targetIds
.map(id => `<@${id}>`)
.map(id => `User ID: ${id}`)
.join(', ')} with the following emojis: ${emojis.join(' ')}.`
);
setTimeout(() => confirmationMsg.delete().catch(console.error), deleteTimeout);

@ -1,12 +1,14 @@
module.exports = {
name: 'reply',
description: `Automatically reply with a specified message to multiple users messages, or stop replying.`,
description: `Automatically reply with a specified message to multiple users' messages, or stop replying.`,
async execute(message, args, deleteTimeout) {
const { processUserInput } = require('../utils/userUtils');
if (args.length === 0) {
if (message.client.targetReplyUserIds && message.client.replyMessage) {
const statusMsg = await message.channel.send(
`Currently replying to messages from the following users: ${message.client.targetReplyUserIds
.map(id => `<@${id}>`)
.map(id => `User ID: ${id}`)
.join(', ')} with the message: "${message.client.replyMessage}".`
);
setTimeout(() => statusMsg.delete().catch(console.error), deleteTimeout);
@ -33,11 +35,11 @@ module.exports = {
return;
}
const targetIds = args[0].split(',').map(id => id.trim());
const targetIds = processUserInput(args[0]);
const replyMessage = args.slice(1).join(' ');
if (targetIds.length === 0 || !replyMessage) {
const errorMsg = await message.channel.send('Please provide valid user IDs and a message to reply with.');
const errorMsg = await message.channel.send('Please provide valid user IDs or @mentions and a message to reply with.');
setTimeout(() => errorMsg.delete().catch(console.error), deleteTimeout);
return;
}
@ -47,7 +49,7 @@ module.exports = {
const confirmationMsg = await message.channel.send(
`I will now reply to messages from the following users: ${targetIds
.map(id => `<@${id}>`)
.map(id => `User ID: ${id}`)
.join(', ')} with the message: "${replyMessage}".`
);
setTimeout(() => confirmationMsg.delete().catch(console.error), deleteTimeout);

391
package-lock.json generated

@ -6,22 +6,24 @@
"": {
"dependencies": {
"csv-parse": "^5.5.6",
"discord.js-selfbot-v13": "^3.5.1",
"discord.js-selfbot-v13": "^3.6.1",
"dotenv": "^16.4.1",
"libsodium-wrappers": "^0.7.13",
"opusscript": "^0.0.8"
"node-fetch": "^3.3.2",
"opusscript": "^0.0.8",
"ssh2": "^1.16.0"
}
},
"node_modules/@discordjs/builders": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.10.0.tgz",
"integrity": "sha512-ikVZsZP+3shmVJ5S1oM+7SveUCK3L9fTyfA8aJ7uD9cNQlTqF+3Irbk2Y22KXTb3C3RNUahRkSInClJMkHrINg==",
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.10.1.tgz",
"integrity": "sha512-OWo1fY4ztL1/M/DUyRPShB4d/EzVfuUvPTRRHRIt/YxBrUYSz0a+JicD5F5zHFoNs2oTuWavxCOVFV1UljHTng==",
"license": "Apache-2.0",
"dependencies": {
"@discordjs/formatters": "^0.6.0",
"@discordjs/util": "^1.1.1",
"@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "^0.37.114",
"discord-api-types": "^0.37.119",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4",
"tslib": "^2.6.3"
@ -82,6 +84,12 @@
"url": "https://github.com/discordjs/discord.js?sponsor"
}
},
"node_modules/@minhducsun2002/leb128": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@minhducsun2002/leb128/-/leb128-1.0.0.tgz",
"integrity": "sha512-eFrYUPDVHeuwWHluTG1kwNQUEUcFjVKYwPkU8z9DR1JH3AW7JtJsG9cRVGmwz809kKtGfwGJj58juCZxEvnI/g==",
"license": "MIT"
},
"node_modules/@sapphire/async-queue": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.5.tgz",
@ -105,6 +113,30 @@
"node": ">=v16"
}
},
"node_modules/@shinyoshiaki/binary-data": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/@shinyoshiaki/binary-data/-/binary-data-0.6.1.tgz",
"integrity": "sha512-7HDb/fQAop2bCmvDIzU5+69i+UJaFgIVp99h1VzK1mpg1JwSODOkjbqD7ilTYnqlnadF8C4XjpwpepxDsGY6+w==",
"license": "MIT",
"dependencies": {
"generate-function": "^2.3.1",
"is-plain-object": "^2.0.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@shinyoshiaki/jspack": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/@shinyoshiaki/jspack/-/jspack-0.0.6.tgz",
"integrity": "sha512-SdsNhLjQh4onBlyPrn4ia1Pdx5bXT88G/LIEpOYAjx2u4xeY/m/HB5yHqlkJB1uQR3Zw4R3hBWLj46STRAN0rg=="
},
"node_modules/aes-js": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz",
"integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==",
"license": "MIT"
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
@ -129,6 +161,77 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/asn1": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
"integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
"license": "MIT",
"dependencies": {
"safer-buffer": "~2.1.0"
}
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT"
},
"node_modules/bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
"license": "BSD-3-Clause",
"dependencies": {
"tweetnacl": "^0.14.3"
}
},
"node_modules/buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "MIT",
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.2.1"
}
},
"node_modules/buildcheck": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.6.tgz",
"integrity": "sha512-8f9ZJCUXyT1M35Jx7MkBgmBMo3oHTTBIPLiY9xyL0pl3T5RwcPEY8cUHr5LBNfu/fk6c2T4DJZuVM/8ZZT2D2A==",
"optional": true,
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
@ -192,12 +295,52 @@
"node": ">=18"
}
},
"node_modules/cpu-features": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.10.tgz",
"integrity": "sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==",
"hasInstallScript": true,
"optional": true,
"dependencies": {
"buildcheck": "~0.0.6",
"nan": "^2.19.0"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/csv-parse": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-5.6.0.tgz",
"integrity": "sha512-l3nz3euub2QMg5ouu5U09Ew9Wf6/wQ8I++ch1loQ0ljmzhmfZYrH9fflS22i/PQEvsPvxCwxgz5q7UB8K1JO4Q==",
"license": "MIT"
},
"node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
"license": "MIT",
"engines": {
"node": ">= 12"
}
},
"node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
@ -214,15 +357,15 @@
"license": "MIT"
},
"node_modules/discord-api-types": {
"version": "0.37.119",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.119.tgz",
"integrity": "sha512-WasbGFXEB+VQWXlo6IpW3oUv73Yuau1Ig4AZF/m13tXcTKnMpc/mHjpztIlz4+BM9FG9BHQkEXiPto3bKduQUg==",
"version": "0.37.120",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.120.tgz",
"integrity": "sha512-7xpNK0EiWjjDFp2nAhHXezE4OUWm7s1zhc/UXXN6hnFFU8dfoPHgV0Hx0RPiCa3ILRpdeh152icc68DGCyXYIw==",
"license": "MIT"
},
"node_modules/discord.js-selfbot-v13": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/discord.js-selfbot-v13/-/discord.js-selfbot-v13-3.5.1.tgz",
"integrity": "sha512-AG4bYnymw8Ji0fsjVKG0f3gKoH/xuGTKn2TpxGtLhmiL8JwYywsoF7IFQ/Cl3avOPY+MKmeaR0JNScImQvG0tw==",
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/discord.js-selfbot-v13/-/discord.js-selfbot-v13-3.6.1.tgz",
"integrity": "sha512-0RVv3u2sJZaGUKYPsUDtl4Zdbas5XuNGuR6409Qdm0/LLIcVm+677OydcCMDu9njwstwYMNWhl/8Zqpm5OrtnQ==",
"license": "GNU General Public License v3.0",
"dependencies": {
"@discordjs/builders": "^1.6.3",
@ -237,10 +380,11 @@
"tough-cookie": "^4.1.4",
"tree-kill": "^1.2.2",
"undici": "^6.21.0",
"werift-rtp": "^0.8.4",
"ws": "^8.16.0"
},
"engines": {
"node": ">=18.17"
"node": ">=20.18"
}
},
"node_modules/dotenv": {
@ -267,6 +411,29 @@
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"license": "MIT"
},
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"license": "MIT",
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/fetch-cookie": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-2.2.0.tgz",
@ -304,6 +471,27 @@
"node": ">=8"
}
},
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"license": "MIT",
"dependencies": {
"fetch-blob": "^3.1.2"
},
"engines": {
"node": ">=12.20.0"
}
},
"node_modules/generate-function": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
"license": "MIT",
"dependencies": {
"is-property": "^1.0.2"
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@ -322,6 +510,26 @@
"node": ">=8"
}
},
"node_modules/ieee754": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "BSD-3-Clause"
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
@ -331,6 +539,33 @@
"node": ">=8"
}
},
"node_modules/is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
"integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
"license": "MIT",
"dependencies": {
"isobject": "^3.0.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
"license": "MIT"
},
"node_modules/isobject": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
"integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/libsodium": {
"version": "0.7.15",
"resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.7.15.tgz",
@ -377,6 +612,62 @@
"url": "https://tidelift.com/funding/github/npm/loglevel"
}
},
"node_modules/mp4box": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/mp4box/-/mp4box-0.5.4.tgz",
"integrity": "sha512-GcCH0fySxBurJtvr0dfhz0IxHZjc1RP+F+I8xw+LIwkU1a+7HJx8NCDiww1I5u4Hz6g4eR1JlGADEGJ9r4lSfA==",
"license": "BSD-3-Clause"
},
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT"
},
"node_modules/nan": {
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.22.2.tgz",
"integrity": "sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==",
"license": "MIT",
"optional": true
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "github",
"url": "https://paypal.me/jimmywarting"
}
],
"license": "MIT",
"engines": {
"node": ">=10.5.0"
}
},
"node_modules/node-fetch": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
"license": "MIT",
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/opusscript": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.8.tgz",
@ -528,6 +819,17 @@
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
"license": "MIT"
},
"node_modules/rx.mini": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/rx.mini/-/rx.mini-1.4.0.tgz",
"integrity": "sha512-8w5cSc1mwNja7fl465DXOkVvIOkpvh2GW4jo31nAIvX4WTXCsRnKJGUfiDBzWtYRInEcHAUYIZfzusjIrea8gA=="
},
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
@ -540,6 +842,23 @@
"integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==",
"license": "MIT"
},
"node_modules/ssh2": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.16.0.tgz",
"integrity": "sha512-r1X4KsBGedJqo7h8F5c4Ybpcr5RjyP+aWIG007uBPRjmdQWfEiVLzSK71Zji1B9sKxwaCvD8y8cwSkYrlLiRRg==",
"hasInstallScript": true,
"dependencies": {
"asn1": "^0.2.6",
"bcrypt-pbkdf": "^1.0.2"
},
"engines": {
"node": ">=10.16.0"
},
"optionalDependencies": {
"cpu-features": "~0.0.10",
"nan": "^2.20.0"
}
},
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
@ -614,10 +933,16 @@
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
},
"node_modules/tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",
"license": "Unlicense"
},
"node_modules/undici": {
"version": "6.21.1",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz",
"integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==",
"version": "6.21.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.21.2.tgz",
"integrity": "sha512-uROZWze0R0itiAKVPsYhFov9LxrPMHLMEQFszeI2gCN6bnIIZ8twzBCJcN2LJrBBLfrP0t1FW0g+JmKVl8Vk1g==",
"license": "MIT",
"engines": {
"node": ">=18.17"
@ -642,6 +967,34 @@
"requires-port": "^1.0.0"
}
},
"node_modules/web-streams-polyfill": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/werift-rtp": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/werift-rtp/-/werift-rtp-0.8.4.tgz",
"integrity": "sha512-n2FqQoSZnrS6ztMFkMMUee0ORh4JqdkEaaXwJ3NlemCoshcX3bfdKo4HukLwH2oBomfHFRIAvrqGRpo5JdYTzw==",
"license": "MIT",
"dependencies": {
"@minhducsun2002/leb128": "^1.0.0",
"@shinyoshiaki/binary-data": "^0.6.1",
"@shinyoshiaki/jspack": "^0.0.6",
"aes-js": "^3.1.2",
"buffer": "^6.0.3",
"debug": "^4.3.4",
"mp4box": "^0.5.2",
"rx.mini": "^1.2.2"
},
"engines": {
"node": ">=10"
}
},
"node_modules/which-module": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
@ -663,9 +1016,9 @@
}
},
"node_modules/ws": {
"version": "8.18.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
"integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
"version": "8.18.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz",
"integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"

@ -1,7 +1,7 @@
{
"dependencies": {
"csv-parse": "^5.5.6",
"discord.js-selfbot-v13": "^3.5.1",
"discord.js-selfbot-v13": "^3.6.1",
"dotenv": "^16.4.1",
"libsodium-wrappers": "^0.7.13",
"node-fetch": "^3.3.2",

27
utils/userUtils.js Normal file

@ -0,0 +1,27 @@
function extractUserId(input) {
if (/^\d{17,19}$/.test(input)) {
return input;
}
const mentionRegex = /<@!?(\d{17,19})>/;
const match = input.match(mentionRegex);
if (match && match[1]) {
return match[1];
}
return null;
}
function processUserInput(input) {
return input
.split(',')
.map(part => part.trim())
.map(part => extractUserId(part))
.filter(id => id !== null);
}
module.exports = {
extractUserId,
processUserInput
};