dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
717 stars 163 forks source link

[BUG] Cannot edit ClientUser #50

Closed regulad closed 3 years ago

regulad commented 3 years ago

Reproduction Steps

How did you make it happen?

Code

Relevant code that shows the bug.
await client.user.edit(password=password, username="a new user name", avatar=b"Some dang bytes~")

Obviously, the avatar is valid. This is just for example.

Expected Results

What is supposed to happen?

Account's properties become their assigned values, provided the password is correct.

Actual Results

What is currently happening?
Traceback (most recent call last):
  File "some_arbitrary_module.py", line some_arbitrary_line, in some_coroutine
    await client.user.edit(
  File "C:\Users\some_arbitrary_username\PycharmProjects\some_arbitrary_project_name\venv\lib\site-packages\discord\user.py", line 479, in edit
    http._token(data['token'], bot=False)
TypeError: _token() got an unexpected keyword argument 'bot'

...and the user gets phone-locked, but I doubt this is because of this issue.

System Info

Run python -m discord --version and paste the information below.
- Python v3.9.2-final
- discord.py v1.8.1-final
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.21390

Checklist

Let's make sure this issue is valid!

Additional Information

Put any extra context, weird configurations, or other important info here.

I'll likely make a PR to fix this if it's not touched.

caiocinel commented 3 years ago

I did some tests and the problem really happens, this is due to the removal of the BOT parameter from the functions (since it is not necessary), just remove it and it will stop giving this error.

Regarding the .edit function, in my case it worked normally, it changed both the nick and the avatar, I wasn't phone-block, I just got the default countdown because of the tests, so it should work in the next version. (If you don't want to wait, use the 1.x branch, but at your own risk)

This issue will likely be resolved in the next release.

dolfies commented 3 years ago

The error-causing issue will be resolved in the next release, but I do not recommend using it anyway. Discord currently insta-phone locks your account for automating certain things (guild join, changing avatar, sending dms). This will also probably be solved in the next release πŸ˜‰.

caiocinel commented 3 years ago

The error-causing issue will be resolved in the next release, but I do not recommend using it anyway. Discord currently insta-phone locks your account for automating certain things (guild join, changing avatar, sending dms). This will also probably be solved in the next release πŸ˜‰.

Do you know what can make an account not phone-locked when using this func?

dolfies commented 3 years ago

The error-causing issue will be resolved in the next release, but I do not recommend using it anyway. Discord currently insta-phone locks your account for automating certain things (guild join, changing avatar, sending dms). This will also probably be solved in the next release πŸ˜‰.

Do you know what can make an account not phone-locked when using this func?

I don't want to get ahead of myself and say too much yet, but testing results have been positive.