dolfies / discord.py-self

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

A token that require phone verify can't go online or pretend its playing a game #306

Closed Death-cord closed 2 years ago

Death-cord commented 2 years ago

Summary

iirc, in dpy-self v1.9.2 I was able to bring a token that require phone verify online and even pretend its playing a game, now it says "you need to verify your account ..."

Reproduction Steps

All done.

Code

await self.change_presence(status=discord.Status.idle, activity=discord.Game("Minecraft"))

Expected Results

It should bring the token online and pretend its playing a game, worked on dpy-self v1.9.2, but not anymore in v2.0

Actual Results

Traceback (most recent call last): File "obfuscated.py", line 952, in on_ready await self.change_presence(status=discord.Status.idle, activity=discord.Game("Minecraft")) File "C:\Users\obfuscated\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 1393, in change_presence await self.user.edit_settings(payload) # type: ignore # user is always present when logged in File "C:\Users\obfuscated\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\user.py", line 877, in edit_settings data = await state.http.edit_settings(payload) File "C:\Users\obfuscated\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 572, in request raise Forbidden(response, data) discord.errors.Forbidden: 403 Forbidden (error code: 40002): You need to verify your account in order to perform this action.

System Information

Checklist

Additional Information

No response

TheOnlyWayUp commented 2 years ago

Does this still work on v1.9.2?

Death-cord commented 2 years ago

I guess yes, didn't try it for a long time though.

TheOnlyWayUp commented 2 years ago

Please try it now and comment the results or update your post with them, this will help us figure out if it's a library change or a discord API Change. I'm heavily leaning towards it being the latter. If it is a library issue though, there's a chance for it to be fixed.

dolfies commented 2 years ago

We already discussed this on telegram, this is a library issue (locked accounts can't PATCH settings and the error should be suppressed).

dolfies commented 2 years ago

Looking closer at the traceback, it looks like this error isn't emitted from the library. I'm debating suppressing it in this case as change_presence has an edit_settings parameter that disables the settings PATCHing, and this error can be caught and suppressed manually anyway.

dolfies commented 2 years ago

Yeah I don't want to suppress errors for something you initiate yourself. Pass the presence to the Client initialization, use the edit_settings parameter if you know the account is locked, or catch the error yourself.