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)
- voice messages failing HOT 2
- [User Apps] SendSlash with user apps? HOT 1
- An issue with audit log feature HOT 2
- Thread create event not emitting HOT 1
- client.fetchInvite throwing errors every single time
- DiscordAPIError: invalid-input-response
- Error when creating a server HOT 1
- message.Clickbutton failing to find buttons And displaying incorrect error. HOT 2
- Cannot do Slash commands in a user DMS but the same script works on guild HOT 1
- <Message>.clickButton() does not return a modal
- <Modal>.reply() throws an error incorrectly HOT 1
- ERROR | NEW UPDATE HOT 2
- Problem logging into the server HOT 1
- custom status dont work with the newest version HOT 1
- GUILD_MEMBERS_TIMEOUT Members didn't arrive in time HOT 1
- MESSAGE_ID_NOT_FOUND when a thread is created in the event "messageCreate" HOT 2
- After some time of running, bot doesnt to anything anymore HOT 5
- Send Slash in DM USER HOT 3
- Unknown Message Error after using acceptInvite HOT 4
- Cannot set properties of undefined (setting 'keepAlive') HOT 8
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.