-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendFriendRequest() is detected and leads to practically immediate account termination #1453
Comments
confirm (-3 tokens) |
I don't know why, but it always returns code 80000 |
yeah, I just checked the api changed. I'm editing the code and making a pull request rn |
Either it changed or I added my account in a different way then what was tried before |
Just tried it again on discord.js-selfbot-v13 3.5.1 and got Incoming friend requests disabled. Yea I buy aged tokens for cheap on z2u so I can test but yea. 'use strict';
const Captcha = require('2captcha');
const { Client } = require('discord.js-selfbot-v13');
const CAPTCHA_API_KEY = 'APIKEY';
const TOKEN = 'TOKEN';
const TARGET_USER_ID = 'USERID';
const MESSAGE = 'Hello!';
const solver = new Captcha.Solver(CAPTCHA_API_KEY);
const client = new Client({
checkUpdate: false,
captchaSolver: async (captcha, userAgent) => {
try {
const { captcha_sitekey, captcha_rqdata } = captcha;
console.log('Submitting CAPTCHA to 2Captcha...');
const result = await solver.hcaptcha(captcha_sitekey, 'https://discord.com', {
invisible: 1,
userAgent: userAgent,
data: captcha_rqdata,
});
console.log('CAPTCHA solved successfully:', result);
return result.data || result.request;
} catch (error) {
console.error('Failed to solve CAPTCHA:', error);
return null;
}
},
captchaRetryLimit: 3,
});
client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
sendMessageToUser(TARGET_USER_ID, MESSAGE);
});
async function sendMessageToUser(userId, text) {
try {
const user = await client.users.fetch(userId);
console.log(`Sending message to ${user.username} (${userId})...`);
await user.send(text);
console.log('Message sent successfully!');
} catch (error) {
console.error(`Failed to send message to ${userId}: ${error.message}`);
if (error.message.includes('CAPTCHA')) {
console.error(`CAPTCHA encountered while sending message to ${userId}.`);
} else {
console.log("Skipped friend request cause detected");
console.log(`Attempting to send a friend request to ${userId}...`);
try {
const user = await client.users.fetch(userId);
const success = await user.sendFriendRequest();
if (success) {
console.log(`Friend request sent successfully to ${user.username} (${userId}).`);
} else {
console.error(`Failed to send friend request to ${userId}.`);
}
} catch (friendRequestError) {
console.error(`Failed to send friend request to ${userId}: ${friendRequestError.message}`);
}
}
} finally {
client.destroy();
process.exit(0);
}
}
process.on('uncaughtException', (error) => {
console.error('Uncaught Exception:', error);
process.exit(1);
});
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
process.exit(1);
});
client.login(TOKEN); |
Which package has the bugs?
The core library
Issue description
Login -> Send friend request -> solve captcha -> get termination email
Code sample
Package version
[email protected]
Node.js version
v20.18.0
Operating system
Windows python 3.12
Priority this issue should have
High (immediate attention needed)
Checklist
Additional Information
When performing the friend request manually via the browser there is no issue. Also there is no issue when sending dms so I assume the captcha solving is not the issue.
The text was updated successfully, but these errors were encountered: