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
825 stars 170 forks source link

DiscordAPIError: Unauthorized #1352

Open Bingonymous opened 6 days ago

Bingonymous commented 6 days ago

Which package has the bugs?

The core library

Issue description

Stack trace: DiscordAPIError: Unauthorized at RequestHandler.execute (/app/node_modules/discord.js-selfbot-v13/src/rest/RequestHandler.js:415:13) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async RequestHandler.push (/app/node_modules/discord.js-selfbot-v13/src/rest/RequestHandler.js:63:14) at async UserManager.fetch (/app/node_modules/discord.js-selfbot-v13/src/managers/UserManager.js:98:18) at async test (/app/dist/test.js:19:22) at async /app/dist/index.js:100:18

I guess it's caused by await bot.users.fetch(userId);.

When I run curl -H "Authorization: token" https://discord.com/api/v9/users/xxxx/profile?with_mutual_guilds=true on the same machine I get the expected data.

Code sample

const user = await bot.users.fetch(userId);

Package version

/

Node.js version

/

Operating system

Debian

Priority this issue should have

Medium (should be fixed soon)

Checklist

Additional Information

No response

AryptonXD commented 13 hours ago

Discord imposes certain restrictions when fetching user data. The request might fail if the user is not in any mutual guilds or is blocked.

Bingonymous commented 6 hours ago

Why does then the other request return the correct data. I guess its something else