Skip to content

Updates to the icon_custom_emoji_id and style fields#5133

Open
ouyooung wants to merge 10 commits intopython-telegram-bot:api_9.4from
ouyooung:master
Open

Updates to the icon_custom_emoji_id and style fields#5133
ouyooung wants to merge 10 commits intopython-telegram-bot:api_9.4from
ouyooung:master

Conversation

@ouyooung
Copy link

No description provided.

Comment on lines 395 to 409
PRIMARY: Final[str] = constants.KeyboardButtonStyle.PRIMARY
""":const:`telegram.constants.KeyboardButtonStyle.PRIMARY`
.. versionadded:: NEXT.VERSION
"""
SUCCESS: Final[str] = constants.KeyboardButtonStyle.SUCCESS
""":const:`telegram.constants.KeyboardButtonStyle.SUCCESS`
.. versionadded:: NEXT.VERSION
"""
DANGER: Final[str] = constants.KeyboardButtonStyle.DANGER
""":const:`telegram.constants.KeyboardButtonStyle.DANGER`
.. versionadded:: NEXT.VERSION
"""
Copy link
Member

Choose a reason for hiding this comment

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

CC @harshil21 do we need this? Its not actually unique to inline keyboard anyway

Copy link
Member

Choose a reason for hiding this comment

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

yeah since it's used in two places, I would just not link it here.

.. versionchanged:: NEXT.VERSION
:attr:`style` is considered as well when comparing objects of this type in terms of
equality.
Copy link
Member

Choose a reason for hiding this comment

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

you also need to add custom_emoji_id here

Comment on lines 249 to 263
PRIMARY: Final[str] = constants.KeyboardButtonStyle.PRIMARY
""":const:`telegram.constants.KeyboardButtonStyle.PRIMARY`
.. versionadded:: NEXT.VERSION
"""
SUCCESS: Final[str] = constants.KeyboardButtonStyle.SUCCESS
""":const:`telegram.constants.KeyboardButtonStyle.SUCCESS`
.. versionadded:: NEXT.VERSION
"""
DANGER: Final[str] = constants.KeyboardButtonStyle.DANGER
""":const:`telegram.constants.KeyboardButtonStyle.DANGER`
.. versionadded:: NEXT.VERSION
"""
Copy link
Member

Choose a reason for hiding this comment

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

same as above

Comment on lines +258 to +260
assert constants.KeyboardButtonStyle.PRIMARY == "primary"
assert constants.KeyboardButtonStyle.SUCCESS == "success"
assert constants.KeyboardButtonStyle.DANGER == "danger"
Copy link
Member

Choose a reason for hiding this comment

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

oh and why did you remove the colour alias tests?

Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

Mostly looks good!

Note:
This type of button **must** always be the first button in the first row and can
only be used in invoice messages.
style (:obj:`str`): Optional. Style of the button. Determines the visual appearance
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
style (:obj:`str`): Optional. Style of the button. Determines the visual appearance
style (:obj:`str`, optional): Style of the button. Determines the visual appearance

Comment on lines 160 to 162
Note:
This feature requires Telegram client version 6.5.1 or later. Older clients
will display the button without styling.
Copy link
Member

Choose a reason for hiding this comment

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

where did you get this from?

Copy link
Author

Choose a reason for hiding this comment

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

I tested it myself.

Copy link
Member

Choose a reason for hiding this comment

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

Please revert it then, since 6.5.1 is an ancient version and most new features would not be expected to work on them anyway.

Copy link
Author

Choose a reason for hiding this comment

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

Okay, I've deleted this note.

Comment on lines 395 to 409
PRIMARY: Final[str] = constants.KeyboardButtonStyle.PRIMARY
""":const:`telegram.constants.KeyboardButtonStyle.PRIMARY`
.. versionadded:: NEXT.VERSION
"""
SUCCESS: Final[str] = constants.KeyboardButtonStyle.SUCCESS
""":const:`telegram.constants.KeyboardButtonStyle.SUCCESS`
.. versionadded:: NEXT.VERSION
"""
DANGER: Final[str] = constants.KeyboardButtonStyle.DANGER
""":const:`telegram.constants.KeyboardButtonStyle.DANGER`
.. versionadded:: NEXT.VERSION
"""
Copy link
Member

Choose a reason for hiding this comment

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

yeah since it's used in two places, I would just not link it here.

ouyooung and others added 2 commits February 14, 2026 19:20
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
@ouyooung ouyooung requested a review from harshil21 February 14, 2026 13:12
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

Successfully merging this pull request may close these issues.

3 participants