Skip to content

Conversation

@dolfies
Copy link
Owner

@dolfies dolfies commented Jul 11, 2021

Summary

Here's a (relatively) short, outdated, non-exhaustive list of the changes in this version:

  • Fixed all open issues.
  • Completely removed all bot-only methods, arguments, and reason kwargs (fuck you reason kwargs)
  • Undeprecated and improve existing user-related methods
  • Adjusted REST API wraps to mimic the official client better
  • Improved backwards compatibility
  • Yeeted LazyUsers (I'm betting this will make a lot of people happy)
  • Yeeted sharding stuff
  • Yeeted useless gateway event parsers
  • Removed guild_create streaming
  • Removed is_bot attributes
  • Fixed Client.fetch_guilds()
  • Fixed Client.fetch_user()
  • Fixed relationships
  • Fixed guild.members (WIP)
  • Fixed activity/status
  • Fixed user agent/headers
  • Fixed most on_* events (unfortunately on_member_join is unfixable for the time being, as Discord just doesn't provide that information reliably)
  • Fixed activity/status on startup (unreliable, because Discord)
  • Fixed chunking (only works if you have the manage_guilds permission unfortunately 😭)
  • Fixed editing your profile
  • Fixed changing settings
  • Fixed changing presence (including custom statuses!)
  • Fixed private channels
  • Added gateway event parsers
  • Added guild subscribing (takes advantage of the member sidebar to scrape all* guild members using undocumented opcode 14s) (WIP)
  • Added joining guilds (Client.join_guild() & Invite.use())
  • Added settings attribute (WIP)
  • Added bios (about me field), guild avatars, and banners + banner colors (kinda)
  • Added disabling/deleting accounts
  • Added forcing GUILD_CREATEs for unavailable guilds (UNTESTED!)
  • Added X-Super-Properties (header Discord uses for fingerprinting)
  • Added X-Context-Properties (header Discord uses for certain (sensitive?) actions (joining guilds, creating dms, sending friend reqs); without this, your account gets phone-locked

Note: This is not everything.

Documentation

Before this is released and pushed to PyPi, I'll update the website (which is kinda trash right now) with an exhaustive list of everything public that was added, removed, and changed.

I am not going to document internal changes (outside of updating docstrings) as that will take waaayyy too long.

Credits

Huge thanks to arandomnewaccount and Discord-S.C.U.M for helping me navigate the mess that is Discord's APIs.

Conclusion

This version of the project is almost finished. To keep the feature-creep back, I'm only going to do the following before release:

  • Add scheduling and ratelimit handling for the subscribing at startup
  • Test some of the changes
  • (Maybe?) refactor some badly written code so it fits in better with the original discord.py.

Some people have been asking about what will happen when 2.0 releases. I will rebase this project to that version, however, it won't be quick. v2.0 adds type-hints to the entire project, completely removes everything user-related, and changes a lot of things internally.

A lot of people have asked me to rename the project, because it conflicts with the original discord.py. I will not be doing this. I have chosen to keep the same package name in the name of backwards-compatibility. There is a scary amount of closed-source selfbots that cannot be easily edited to change import discord to import packagename as discord. Python has a great feature called virtual environments that can help people wanting to use both libs.


I also want to address one final issue

I see a lot of Python beginners using this project to create something that would work perfectly fine as a regular bot. I want to make it clear that you shouldn't break the Discord ToS for no reason (no matter how bad it is), and that working with a library such as this or the original discord.py for your first coding adventure is not a good idea. Get familiar with Python first, and then come back to the mess that is the Discord API. If you do come back, consider using a regular bot.
I don't want script-kiddies getting banned for being curious. Been there, done that.

The reason I created this fork was to fix/improve upon discord.py's support of selfbots, and keep it maintained when discord.py removes it. Even though selfbots are against Discord ToS, I believe people should have a choice; writing code isn't against ToS, but using this library, unfortunately, is.
For that reason, I cannot ever recommend anybody ever uses this, and I carry no responsibility for any crap you do.

In my opinion, Discord banning selfbots was an incredibly stupid idea. It hasn't stopped bad actors from using them, it has only affected regular people trying to enhance their chat experience on what is (or at least used to be) a wonderful platform, with a wonderful community, and caring staff.

They had good intentions, but the selfbot detection is easy to work around (and always will be). Raids, dm spam, and all the other cons of selfbots still occur. Raiders, spammers, and advertisers don't care if their alts get disabled, or even if their mains get banned; they'll just generate a few hundred more tokens and continue. Disabled accounts only affect the people that aren't raiding, spamming, or advertising; just having fun. The selfbot ban only stops people that actually use Discord for keeping in touch with friends and being a part of communities they love, and wanted to tinker, carry around some extra chatting features, and add functionality to their servers.

Selfbotting is very low-risk to people that will abuse it, and high-risk to people that want to mess around and create cool things on their account.

The solution is not banning selfbotting as a whole. It is acting against people who abuse the Discord API.
If you support this, please go vote here and tell Discord how you feel.

For all of you saying "just use a bot":

  • You can't invite your bot to all the servers you're in
  • Certain actions are user-only
  • You can't impersonate yourself with a bot
    ...amongst other things

~Dolfies

@dolfies dolfies self-assigned this Jul 11, 2021
@dolfies
Copy link
Owner Author

dolfies commented Jul 12, 2021

Since it is no longer set Self_bot=True on startup, commands will never be executed due to:

I'm not sure what you mean. The behavior of the self_bot kwarg hasn't changed.

@caiocinel
Copy link

I'm not sure what you mean. The behavior of the self_bot kwarg hasn't changed.

My stupidity, not to lose the habit ;(
It's past my time to go to bed

@dolfies
Copy link
Owner Author

dolfies commented Jul 12, 2021

My stupidity, not to lose the habit ;(
It's past my time to go to bed

Been there, done that lol

@regulad
Copy link

regulad commented Jul 18, 2021

Would it be possible to reimplement the Client#login method so it accepts an email and password, like in d.py < 1.0?

@dolfies dolfies linked an issue Jul 31, 2021 that may be closed by this pull request
4 tasks
@dolfies dolfies marked this pull request as ready for review July 31, 2021 20:26
@dolfies
Copy link
Owner Author

dolfies commented Jul 31, 2021

This is basically ready, and the "docs" are finally up. Unless major bugs are found, I will be pushing soon.

@duartesaraiiva
Copy link

Can't launch my bot with the latest commit in the dev branch
File "E:\Projects\SelfBOT\.env\lib\site-packages\discord\state.py", line 451, in parse_ready_supplemental self.user = user = ClientUser(state=self, data=data['user']) File "E:\Projects\SelfBOT\.env\lib\site-packages\discord\user.py", line 565, in __init__ self.note = Note(state, self.id, user=self) AttributeError: 'ClientUser' object has no attribute 'note' Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000019EB20E3F70>

@dolfies
Copy link
Owner Author

dolfies commented Aug 1, 2021

Crap. Forgot to add it to the slots. Commit incoming.

@dolfies
Copy link
Owner Author

dolfies commented Aug 1, 2021

That's what happens when you forget to git push.

@destroyace
Copy link

Is there a scheduled update date for v1.9? Thanks.

@dolfies
Copy link
Owner Author

dolfies commented Aug 3, 2021

It's basically done. This week I'm just going to do some bug-testing.

If everything goes well it should be out by the weekend.

I would appreciate people looking over the docs for mistakes and testing out the update.

@dolfies dolfies merged commit 353cb9d into v1.x Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment