Updates to the icon_custom_emoji_id and style fields#5133
Open
ouyooung wants to merge 10 commits intopython-telegram-bot:api_9.4from
Open
Updates to the icon_custom_emoji_id and style fields#5133ouyooung wants to merge 10 commits intopython-telegram-bot:api_9.4from
ouyooung wants to merge 10 commits intopython-telegram-bot:api_9.4from
Conversation
…dButton, allowing bots to change the color of buttons.
Poolitzer
reviewed
Feb 13, 2026
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 | ||
| """ |
Member
There was a problem hiding this comment.
CC @harshil21 do we need this? Its not actually unique to inline keyboard anyway
Member
There was a problem hiding this comment.
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. | ||
Member
There was a problem hiding this comment.
you also need to add custom_emoji_id here
src/telegram/_keyboardbutton.py
Outdated
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 | ||
| """ |
Poolitzer
reviewed
Feb 13, 2026
Comment on lines
+258
to
+260
| assert constants.KeyboardButtonStyle.PRIMARY == "primary" | ||
| assert constants.KeyboardButtonStyle.SUCCESS == "success" | ||
| assert constants.KeyboardButtonStyle.DANGER == "danger" |
Member
There was a problem hiding this comment.
oh and why did you remove the colour alias tests?
harshil21
requested changes
Feb 14, 2026
| 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 |
Member
There was a problem hiding this comment.
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. |
Member
There was a problem hiding this comment.
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.
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 | ||
| """ |
Member
There was a problem hiding this comment.
yeah since it's used in two places, I would just not link it here.
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.