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

Fixed get_custom_emoji_stickers method #1002

Merged
merged 4 commits into from Sep 18, 2022
Merged

Fixed get_custom_emoji_stickers method #1002

merged 4 commits into from Sep 18, 2022

Conversation

ENCRYPTEDFOREVER
Copy link

@ENCRYPTEDFOREVER ENCRYPTEDFOREVER commented Sep 17, 2022

Description

By default if you call str() on collection python will escape strings inside of it using single quotes, which will cause

Can't parse custom emoji identifiers json object

error when calling getCustomEmojiStickers(). json.dumps() escapes strings by double quotes so no error occurs.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Test Configuration

  • Operating system: Windows 11 22000.708

  • Python version: 3.10.6

  • My code follows the style guidelines of this project

  • I have performed a self-review of my own code

  • My changes generate no new warnings or errors

  • My changes are compatible with minimum requirements of the project

By default if you call str() on collection python will escape strings inside of it using single quotes, which will cause "Can't parse custom emoji identifiers json object" error when calling getCustomEmojiStickers.
json.dumps() escapes strings by double quotes so no error occurs.
@github-actions github-actions bot added the 2.x Issue or PR for stable 2.x version label Sep 17, 2022
@evgfilim1 evgfilim1 added bug Something is wrong with the framework needs triage This issue is not yet confirmed labels Sep 18, 2022
Copy link
Member

@JrooTJunior JrooTJunior left a comment

Choose a reason for hiding this comment

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

Fixed not in the right way.

You shouldn't modify the compose_data method, you should add the custom_emoji_ids = prepare_arg(custom_emoji_ids) statement inside method as the same way as the results argument in answer_inline_query method.

@ENCRYPTEDFOREVER
Copy link
Author

Fixed not in the right way.

You shouldn't modify the compose_data method, you should add the custom_emoji_ids = prepare_arg(custom_emoji_ids) statement inside method as the same way as the results argument in answer_inline_query method.

Fixed. Sorry, i'm not very familiar to aiogram's structure

@ENCRYPTEDFOREVER ENCRYPTEDFOREVER changed the title Fixed possible incorrect escaping of strings inside collections. Fixed get_custom_emoji_stickers method Sep 18, 2022
@JrooTJunior JrooTJunior merged commit 95dc3fc into aiogram:dev-2.x Sep 18, 2022
@JrooTJunior
Copy link
Member

Thank you for your contribution

@evgfilim1 evgfilim1 removed the needs triage This issue is not yet confirmed label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issue or PR for stable 2.x version bug Something is wrong with the framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants