Comments (7)
Is that a yes 😆 I don't want to submit a PR if you're already working on something.
I'm working on interactions at the moment, so you can submit a PR .-.
from discord.js-selfbot-v13.
Update: It's actually more complex for guilds! For guilds users receive the threads via the GUILD_CREATE event you receive upon startup, probably because users always cache channels and guilds unlike bots which can be picky about what they cache. I'll probably create a new object on the guild class which gets populated on startup and also is modified through events such as thread create/thread delete etc.
For channels it's really simple, there's an API call for it.
Not a massive problem but it does add more complexity when keeping the project up-to-date with the discord.js branch, especially when you still want to maintain support for bots where you need to add extra checks.
from discord.js-selfbot-v13.
Issue description
It seems that
ThreadManager.fetchActive
is a bot-only endpoint. The Discord client uses thesearch
API endpoint for the threads dropdown. This may also apply tofetchArchived
.throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: Only bots can use this endpoint at RequestHandler.execute ([redacted]/node_modules/discord.js-selfbot-v13/src/rest/RequestHandler.js:350:13) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push ([redacted]/node_modules/discord.js-selfbot-v13/src/rest/RequestHandler.js:51:14) at async ThreadManager.fetchActive ([redacted]/node_modules/discord.js-selfbot-v13/src/managers/ThreadManager.js:234:17) { method: 'get', path: '/guilds/[redacted]/threads/active', code: 20002, httpStatus: 403, requestData: { json: undefined, files: [] } }
Code sample
// Fails with "DiscordAPIError: Only bots can use this endpoint" const activeThreads = await channel.threads.fetchActive();Package version
2.0.4
Node.js version
18
Operating system
No response
Priority this issue should have
Medium (should be fixed soon)
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
No response
I will block this endpoint, thank you for informing me
I will find another endpoint with similar functionality
from discord.js-selfbot-v13.
It appears users use a special endpoint for this: https://discord.com/api/v9/channels/*************/threads/search?archived=true&sort_by=last_message_time&sort_order=desc&limit=25&offset=0
(grabbed this from network logs) so you can probably set the archived
to false to get active threads. I can submit a PR if @aiko-chan-ai is happy for me to do so.
from discord.js-selfbot-v13.
It appears users use a special endpoint for this:
https://discord.com/api/v9/channels/*************/threads/search?archived=true&sort_by=last_message_time&sort_order=desc&limit=25&offset=0
(grabbed this from network logs) so you can probably set thearchived
to false to get active threads. I can submit a PR if @aiko-chan-ai is happy for me to do so.
ty <3
from discord.js-selfbot-v13.
It appears users use a special endpoint for this:
https://discord.com/api/v9/channels/*************/threads/search?archived=true&sort_by=last_message_time&sort_order=desc&limit=25&offset=0
(grabbed this from network logs) so you can probably set thearchived
to false to get active threads. I can submit a PR if @aiko-chan-ai is happy for me to do so.ty <3
Is that a yes 😆 I don't want to submit a PR if you're already working on something.
from discord.js-selfbot-v13.
Update: It's actually more complex for guilds! For guilds users receive the threads via the GUILD_CREATE event you receive upon startup, probably because users always cache channels and guilds unlike bots which can be picky about what they cache. I'll probably create a new object on the guild class which gets populated on startup and also is modified through events such as thread create/thread delete etc.
For channels it's really simple, there's an API call for it.
Not a massive problem but it does add more complexity when keeping the project up-to-date with the discord.js branch, especially when you still want to maintain support for bots where you need to add extra checks.
(I have no idea where I got guilds from when the issue stems from fetching channel threads but this could be a future thing!)
from discord.js-selfbot-v13.
Related Issues (20)
- Sweep Cache HOT 2
- The ability to send Voice Mails and not just audio files HOT 5
- Uncaught HTTPError Error: CAPTCHA_SOLVER_NOT_IMPLEMENTED While sending messages in non direct message channels HOT 4
- Error: Output formats h264, s16le are not available
- Only the first button is being clicked using message.clickButton HOT 3
- [DiscordApiError] How to handle global error(api and wss)? HOT 2
- captcha solver 'you need to update your app to perform this action' HOT 1
- TypeScript SpotifyRPC Start And End TimeStamp Type Error HOT 1
- Error: INTERACTION_TIMEOUT
- Forum Thread Post Creation "Cannot access 'data' before initialization" HOT 1
- Selfbot: Is it possible to get all of a guild's threads? HOT 3
- help me HOT 2
- DiscordAPIError: Missing Permissions, even if you can do it from the client. HOT 6
- Cant create a MessageButton HOT 3
- No message :v HOT 2
- Get User by ID HOT 3
- [Feature request / a question] How can I fetch all messages from a channel HOT 2
- Error 40003 - You are opening direct messages too fast HOT 3
- Creating poll/Submit answer HOT 2
- Where did the syncStatus ClientOption go? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord.js-selfbot-v13.