V4NSH4J / discord-mass-DM-GO

The most powerful Discord selfbot written in GO allowing users to automate their campaigns & send low-cost mass messages to Discord users!
https://t.me/tosviolators
GNU Affero General Public License v3.0
2.17k stars 634 forks source link

Automatically remove https://discord.gg/ (and others) on invite links #584

Closed itschasa closed 2 years ago

itschasa commented 2 years ago

I don't think it really needs explaining, fixes issues like: #570

V4NSH4J commented 2 years ago

Hey! Thank you for the PR. It is a good solution for a general case as the most popular format of invites is covered by this. But discord invites can be in many different forms I think. Best solution would be to accept all forms that Discord accepts. If we do an x-context-properties request with any link that the Discord Client accepts, it returns the invite code in the response for the server we wish to join (This is one of the uses of the x-context-properties request except the header).

itschasa commented 2 years ago

If it's a link tho, then you can't use it to join servers, it needs striping of its link. Also, X-Content-Properties (last time i checked) only uses the guild ID, channel ID and it's type, which can all be fetched from a GET request, which only uses the code part of the invite. You can see this on the client, and also when you visit invite links online.

itschasa commented 2 years ago

lol

V4NSH4J commented 2 years ago

This is what I mean -> 1) You can put any link here (not just the code)

Screenshot 2022-04-29 at 11 49 51 PM

2) Discord does the x-context-properties request with whatever input you put in

Screenshot 2022-04-29 at 11 50 25 PM

3) It resolves the invite link into an invite code

Screenshot 2022-04-29 at 11 50 42 PM

4) invite code is used to join the server

Screenshot 2022-04-29 at 11 50 53 PM

^ This way users will be able to input ANY link discord supports as an invite, not just discord.gg/code

itschasa commented 2 years ago

in the first image, you can just put a code. therefore it's compatible. but i just thought that it would be useful to automatically remove the link, as if the input is a url, it won't work.

V4NSH4J commented 2 years ago

I say this because Discord invites don't come only in discord.gg/code format you can put any of these and discord still accepts it discord.com/invite/code discord.com/api/v9/invite/code (And older APIs) discord.gg/api/v9/invite/code (And older APIs) discord.com/room discord.com/api/v9/invites/room (And older APIs)

By the method I described, we won't have to hard code all these, they'll be handled by discord on it's own. Even if it's not an actual link, discord sometimes accepts it, so it's best to leave on them what they accept and what they don't Even fake stuff like this ->

Screenshot 2022-04-30 at 12 05 51 AM

We either support everything discord client supports or we just support the code to skip the x-context-properties request

itschasa commented 2 years ago

fair enough, may as well just close this lol

V4NSH4J commented 2 years ago

If you want, most of the code for it is already written, you would just have to return the code from the x-context-properties request, make it return an error if it had any problems getting the x-context-properties and using the invite code to join server to make it compatible with what I'm trying to say.