Skip to content
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

current_user.id doesn't return the discord ID? #27

Open
ITz-Viks opened this issue Aug 25, 2023 · 4 comments
Open

current_user.id doesn't return the discord ID? #27

ITz-Viks opened this issue Aug 25, 2023 · 4 comments

Comments

@ITz-Viks
Copy link

ITz-Viks commented Aug 25, 2023

I'm setting up discord login for my flask app and all is working well except that current_user.id returns an id that is almost right but is off by a couple digits in the end.

I get returned this: 605375003914928100
.....My discord id is: 605375003914928138

How would i get the users discord id?

This is my callback code

response = client.oauth.get_access_token(code, redirect_uri)
access_token = response.access_token
bearer = APIClient(access_token, bearer=True)
current_user = bearer.users.get_current_user()
print(current_user.id)
@ahnaf-zamil
Copy link
Owner

Hello, thanks for making the issue.

Zenora does not manipulate a lot of data coming from Discord, *especially the User ID. So if your User ID is not being returned properly, I'm pretty sure it's an issue on Discord's side.

But since I don't have access to your account and I've never faced this issue, could you try using a development version of zenora and retrace it's source code to see where the problem may originate? That would help a lot.

@ITz-Viks
Copy link
Author

I couldn't find this 'developement version' so i did more testing with version 0.0.3.post1 ( pip show zenora)

As for the source code from what I understand this is what returns the id

def convert_snowflake(arg: Any) -> Union[Snowflake, Any]:
    if not isinstance(arg, (int, str)):
        return arg
    else:
        return Snowflake(arg)

Which clearly doesn't change the value.

I've tested this with another account and got this result:

What got returned - 488770585241845760
What the real id is - 488770585241845773
(difference of 13)

the other account had a difference of 38.

It may be from discord's side ig. Do you have any ideas?

@ahnaf-zamil
Copy link
Owner

By "development" version, I mean the one in the GitHub repository with the latest changes. And I'm not quite sure what may be causing this.

How about, you take the Discord ID given to you by Zenora and make a user query with it. If that returns any data, it means the ID should work.

@ITz-Viks
Copy link
Author

ITz-Viks commented Aug 28, 2023

I can't @ myself with the ID that got returned, it just says @Unknown User I'll try getting the id again with the development version tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants