Skip to content
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

Open
3 tasks done
Maxhem2 opened this issue Jan 22, 2025 · 7 comments
Open
3 tasks done
Labels
bug Something isn't working help wanted Extra attention is needed Risky Action Discord may ban your account.

Comments

@Maxhem2
Copy link

Maxhem2 commented Jan 22, 2025

Which package has the bugs?

The core library

Issue description

Login -> Send friend request -> solve captcha -> get termination email

Code sample

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}`);
}

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

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

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.

@Maxhem2 Maxhem2 added the bug Something isn't working label Jan 22, 2025
@aiko-chan-ai aiko-chan-ai added help wanted Extra attention is needed Risky Action Discord may ban your account. labels Jan 22, 2025
@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Jan 22, 2025

confirm (-3 tokens)

@aiko-chan-ai
Copy link
Owner

I don't know why, but it always returns code 80000

@TheDevYellowy
Copy link
Contributor

this is code 80000

Image

@aiko-chan-ai
Copy link
Owner

this is code 80000

Image

Discord really makes these error codes more confusing.

@TheDevYellowy
Copy link
Contributor

yeah, I just checked the api changed. I'm editing the code and making a pull request rn

@TheDevYellowy
Copy link
Contributor

Either it changed or I added my account in a different way then what was tried before

@Maxhem2
Copy link
Author

Maxhem2 commented Jan 23, 2025

Just tried it again on discord.js-selfbot-v13 3.5.1 and got Incoming friend requests disabled.
Immediately, I still got Account Disabled - Violation of TOS/Community Guidelines Notification

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed Risky Action Discord may ban your account.
Projects
None yet
Development

No branches or pull requests

3 participants