aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
751 stars 160 forks source link

Connected Accounts always are an empty array #240

Closed MrlolDev closed 2 years ago

MrlolDev commented 2 years ago

Which package has the bugs?

The core library

Issue description

  1. I am with the version 2.4.12
  2. I get the users from an specific guild
  3. Then I fetch the user
  4. Then when I log the user I can't see the connected Accounts since the array is always empty

Code sample

const { Client } = require("discord.js-selfbot-v13");
const client = new Client({
  checkUpdate: false,
}); // All partials are loaded automatically

client.on("ready", async () => {
  console.log(`${client.user.username} is ready!`);
  var guilds = await client.guilds.cache.map((g) => g.id);
  guilds.forEach(async (g) => {
    var guild = await client.guilds.cache.get(g);
    var members = await guild.members.fetch();
    members = members.filter((m) => !m.user.bot);
    members.forEach(async (m) => {
      if (m.user.bot) return;
      var user = await client.users.fetch(m.user.id);
      console.log(user);
    });
    console.log(`${guild.name} has ${members.size} members`);
  });
});

client.login(
  "Mytoken"
);

Package version

2.4.12

Node.js version

16.13

Operating system

Windows

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

No response

MrlolDev commented 2 years ago

It happens the same with the bio that always is null

aiko-chan-ai commented 2 years ago

It happens the same with the bio that always is null

use getProfile after fetch

https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/User?scrollTo=getProfile

MrlolDev commented 2 years ago

Thanks it works

MrlolDev commented 2 years ago

image Now it doesn't work and stop the loop

aiko-chan-ai commented 2 years ago

image Now it doesn't work and stop the loop

What err ?

MrlolDev commented 2 years ago

image I also try with this

MrlolDev commented 2 years ago

image Now it doesn't work and stop the loop

What err ?

It doesn't give any error it only stop the loop and doesn't log anything

aiko-chan-ai commented 2 years ago

image Now it doesn't work and stop the loop

What err ?

It doesn't give any error it only stop the loop and doesn't log anything

I have reproduced the code and it works, you can do another test

MrlolDev commented 2 years ago

image image

MrlolDev commented 2 years ago

Is all inside the ready event

MrlolDev commented 2 years ago

image image

MrlolDev commented 2 years ago

Continue not working :(

MrlolDev commented 2 years ago

Now it works thanks for everything and sorry for bother you

MrlolDev commented 2 years ago

Hello, I have seen that the problem goes and comes since now the exact same code that works 25 minutes ago doesn't work

MrlolDev commented 2 years ago

image I think the error is here since I have tested and the second console log never appears

MrlolDev commented 2 years ago

Where is the function this.client.api.users... I don't find the file

aiko-chan-ai commented 2 years ago

Where is the function this.client.api.users... I don't find the file

https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/API.md#HTTP-APIs

aiko-chan-ai commented 2 years ago

fixed https://github.com/aiko-chan-ai/discord.js-selfbot-v13/commit/de5fe927a35e145bd60afa702e5fa5d614b7a0c9