-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Rework login-flow to retrieve user object from appinfo #9499
base: master
Are you sure you want to change the base?
Conversation
@@ -610,8 +610,8 @@ async def login(self, token: str) -> None: | |||
token = token.strip() | |||
|
|||
data = await self.http.static_login(token) | |||
self._connection.user = ClientUser(state=self._connection, data=data) | |||
self._application = await self.application_info() | |||
self._connection.user = ClientUser(state=self._connection, data=data['bot']) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it would be better to raise above here if 'bot' not in data
.
I don't think it can ever happen though.
Do we want add support for the new PATCH endpoint for applications? |
Sure. |
Seems the branch in the API docs has been merged. Given last week I checked and it didn't have the fields, I'm guessing that it's not happening. |
Yeah, they basically said to make an issue if we want it but my experience with that means that it's never happening. |
3717ed6
to
8953938
Compare
Summary
This PR reworks login flow to use the new
bot
key in the application payload for the ClientUser object, rather than making a 2nd HTTP request.Note: in its current form, the user object provided by discord by this endpoint lacks information previously used in the
ClientUser
object, this PR should only be accepted if discord commits to adding the missing information.Information currently lacking:
locale
mfa_enabled
verified
Checklist