Visitar URL original
Change variable name to avoid conflts with Telegram TL schema by allen0099 · Pull Request #690 · pyrogram/pyrogram · GitHub
The Wayback Machine - https://web.archive.org/web/20240125034247/https://github.com/pyrogram/pyrogram/pull/690
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

Change variable name to avoid conflts with Telegram TL schema #690

Merged
merged 5 commits into from Aug 28, 2021
Merged

Change variable name to avoid conflts with Telegram TL schema #690

merged 5 commits into from Aug 28, 2021

Conversation

allen0099
Copy link
Contributor

Currently, the api compiler is using data as its function argument.

However, updateBotCallbackQuery is use the same word data as its argument.
It will cause the problem when the bot gets the callback query with no data (Like the game button).

Trying to fix issue #608 and make game button usable.

@@ -110,7 +110,7 @@ async def _parse(client, callback_query, users) -> "CallbackQuery":
# ignoring/replacing errors, this way, button clicks will still work.
try:
data = callback_query.data.decode()
except UnicodeDecodeError:
except (UnicodeDecodeError, AttributeError):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AttributeError, what for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Game button will return data with None

@delivrance
Copy link
Member

You forgot to rename some occurrences (I fixed those). Also, I've renamed to b (bytes, buffer) as it used to be.

@Sea-n
Copy link

Sea-n commented Jul 7, 2021

Hey devs, any update on this PR?
I need this patch too. 🙇‍♂️

@asimaranov
Copy link

I faced with this issue to. The following exception occurres if I click game button
IMG_20210812_122033_463. Please fix

@delivrance delivrance merged commit 4d933b8 into pyrogram:master Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants