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

Selfbot: Is it possible to get all of a guild's threads? #1137

Open
DominosCinnaStix opened this issue Apr 10, 2024 · 3 comments
Open

Selfbot: Is it possible to get all of a guild's threads? #1137

DominosCinnaStix opened this issue Apr 10, 2024 · 3 comments
Labels
Feature Request a new feature

Comments

@DominosCinnaStix
Copy link

DominosCinnaStix commented Apr 10, 2024

Which package is the feature request for?

The core library

Feature

It seems that only bot accounts can use the fetch active threads.

The only other selfbot solution appears to be sending an API request for EVERY text channel to get its threads. Now this can be problematic when you don't know which channel will have the threads because it'll be a lot of requests in a short time span.

Ideal solution or implementation

Does anyone know if there's a less API-spammy way to get all active/archived threads? I guess, can we figure out which text channels does have threads? Then I could only fetch those. What does the discord client do?

Alternative solutions or implementations

No response

Other context

No response

@DominosCinnaStix DominosCinnaStix added the Feature Request a new feature label Apr 10, 2024
@TheDevYellowy
Copy link
Contributor

TheDevYellowy commented Apr 11, 2024

if you fetch messages there is a type, type 18 is a thread ( idk if it's active or not I couldn't find a not active one to test on ).

{
  "attachments": [],
  "author": {},
  "channel_id": "",
  "components": [],
  "content": "", // ( the name of the thread )
  "edited_timestamp": null | "",
  "embeds": [],
  "flags": 0,
  "id": "",
  "mention_everyone": false,
  "mention_roles": [],
  "mentions": [],
  "message_reference": {},
  "pinned": false,
  "thread": {}, // data about the thread
  "timestamp": "",
  "tts": false,
  "type": 18
}

@DominosCinnaStix
Copy link
Author

if you fetch messages there is a type, type 18 is a thread ( idk if it's active or not I couldn't find a not active one to test on ).

{
  "attachments": [],
  "author": {},
  "channel_id": "",
  "components": [],
  "content": "", // ( the name of the thread )
  "edited_timestamp": null | "",
  "embeds": [],
  "flags": 0,
  "id": "",
  "mention_everyone": false,
  "mention_roles": [],
  "mentions": [],
  "message_reference": {},
  "pinned": false,
  "thread": {}, // data about the thread
  "timestamp": "",
  "tts": false,
  "type": 18
}

Mhmm, but this would lead to sending even more API requests just to figure out which channels have threads. I'd have to repeatedly fetch messages from all text based channels, which doesn't sound friendly to Discord' API

@DominosCinnaStix
Copy link
Author

Hmm, I decided to look at DevTools when running Discord. I saw that Discord is able to get the small menu list when hovering over a channel that has threads WITHOUT sending an API request. I looked at the WS events it sends and by sending

{
    "op": 37,
    "d": {
        "subscriptions": {
            "GUILD_ID": {
                "typing": true,
                "activities": true,
                "threads": true
            }
        }
    }
}

the client recieves a THREAD_LIST_SYNC that contains thread objects in that guild. I don't know if theres a limit on how many it sends, but it is definitely enough for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants