Add ButtonStyle enum to represent button styles in the Telegram API

This commit is contained in:
JRoot Junior 2026-02-09 20:27:30 +02:00
parent 45c4c2bee5
commit 8783c4922e
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
5 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,9 @@
name: ButtonStyle
description: |
This object represents a button style (inline- or reply-keyboard).
Source: https://core.telegram.org/bots/api#chat
parse:
entity: InlineKeyboardButton
attribute: style
regexp: "'([a-z]+)'"

View file

@ -1,4 +1,5 @@
from .bot_command_scope_type import BotCommandScopeType from .bot_command_scope_type import BotCommandScopeType
from .button_style import ButtonStyle
from .chat_action import ChatAction from .chat_action import ChatAction
from .chat_boost_source_type import ChatBoostSourceType from .chat_boost_source_type import ChatBoostSourceType
from .chat_member_status import ChatMemberStatus from .chat_member_status import ChatMemberStatus
@ -36,6 +37,7 @@ from .update_type import UpdateType
__all__ = ( __all__ = (
"BotCommandScopeType", "BotCommandScopeType",
"ButtonStyle",
"ChatAction", "ChatAction",
"ChatBoostSourceType", "ChatBoostSourceType",
"ChatMemberStatus", "ChatMemberStatus",

View file

@ -0,0 +1,13 @@
from enum import Enum
class ButtonStyle(str, Enum):
"""
This object represents a button style (inline- or reply-keyboard).
Source: https://core.telegram.org/bots/api#chat
"""
DANGER = "danger"
SUCCESS = "success"
PRIMARY = "primary"

View file

@ -0,0 +1,9 @@
###########
ButtonStyle
###########
.. automodule:: aiogram.enums.button_style
:members:
:member-order: bysource
:undoc-members: True

View file

@ -11,6 +11,7 @@ Here is list of all available enums:
:maxdepth: 1 :maxdepth: 1
bot_command_scope_type bot_command_scope_type
button_style
chat_action chat_action
chat_boost_source_type chat_boost_source_type
chat_member_status chat_member_status