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

getUserGifts/getUserGift returns None #3250

Open
CryptoAllcash opened this issue Feb 17, 2025 · 7 comments
Open

getUserGifts/getUserGift returns None #3250

CryptoAllcash opened this issue Feb 17, 2025 · 7 comments

Comments

@CryptoAllcash
Copy link

when trying to call almost any method related to gifts I always receive None. also haven't seen that these methods were implemented even though they are mentioned in the docs

@levlam
Copy link
Contributor

levlam commented Feb 17, 2025

This isn't related to the Bot API server, You receive None from your Bot API library/framework.

@CryptoAllcash
Copy link
Author

CryptoAllcash commented Feb 17, 2025

I am using them directly through the tdlib json interface.

I used this as an example https://github.com/tdlib/td/blob/master/example/python/tdjson_example.py

and tried using this method: https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1get_user_gifts.html

when I try to see the response via td_receive I am seeing None

if you can show how to call it correctly, I'd really appreciate that

I was using td_send({'@type': 'getUserGifts', 'user_id': 762137, 'offset': "", 'limit': 10 })

@levlam
Copy link
Contributor

levlam commented Feb 18, 2025

See https://core.telegram.org/tdlib/docs/td__json__client_8h.html for the description of the correct usage of the JSON interface.

@CryptoAllcash
Copy link
Author

I am already using this. I tried calling a few other methods like getUser or getAvailableGifts and everything works as expected.

When I try to call getUserGifts I receive this: b'{'@type': 'error', 'code': 400, 'message': 'Failed to parse JSON object as TDLib request: Unknown class "getUserGifts"', '@client_id': 1}'

Please help, I checked the docs a couple of times and I don't see any difference between those methods besides the parameters.

@tdlib tdlib deleted a comment from Abudl68 Feb 19, 2025
@levlam
Copy link
Contributor

levlam commented Feb 19, 2025

The error means that your TDLib version doesn't support the request. You use documentation from a different version.

@CryptoAllcash
Copy link
Author

CryptoAllcash commented Feb 21, 2025

So I was using these website as mentioned in getting started to build the tdlib. https://tdlib.github.io/td/build.html

I've made a search through all of the files and in this repository this function getUserGifts doesn't exist. Other functions do exist like getAvailableGifts and that's why they are working. So where can I get a different version of the tdlib?

@levlam
Copy link
Contributor

levlam commented Feb 21, 2025

The build instructions build the latest TDLib version. You can find documentation for the latest version at https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl.

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