Add KeyboardButtonPollTypeType enum (#1398)

* Add KeyboardButtonPollTypeType enum

A new enum, KeyboardButtonPollType, has been added and documented. This enum holds types of polls that can be created and sent when the corresponding button is pressed. It is now imported and included in the aiogram enums documentation.

* Added changelog
This commit is contained in:
Alex Root Junior 2024-01-27 18:04:05 +02:00 committed by GitHub
parent eeafe4696c
commit d3c63797b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,8 @@
name: KeyboardButtonPollTypeType
description: |
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
Source: https://core.telegram.org/bots/api#keyboardbuttonpolltype
static:
QUIZ: "quiz"
REGULAR: "regular"

1
CHANGES/1398.feature.rst Normal file
View file

@ -0,0 +1 @@
A new enum :code:`KeyboardButtonPollTypeType` for :code:`KeyboardButtonPollTypeType.type` field has bed added.

View file

@ -9,6 +9,7 @@ from .dice_emoji import DiceEmoji
from .encrypted_passport_element import EncryptedPassportElement from .encrypted_passport_element import EncryptedPassportElement
from .inline_query_result_type import InlineQueryResultType from .inline_query_result_type import InlineQueryResultType
from .input_media_type import InputMediaType from .input_media_type import InputMediaType
from .keyboard_button_poll_type_type import KeyboardButtonPollTypeType
from .mask_position_point import MaskPositionPoint from .mask_position_point import MaskPositionPoint
from .menu_button_type import MenuButtonType from .menu_button_type import MenuButtonType
from .message_entity_type import MessageEntityType from .message_entity_type import MessageEntityType
@ -34,6 +35,7 @@ __all__ = (
"EncryptedPassportElement", "EncryptedPassportElement",
"InlineQueryResultType", "InlineQueryResultType",
"InputMediaType", "InputMediaType",
"KeyboardButtonPollTypeType",
"MaskPositionPoint", "MaskPositionPoint",
"MenuButtonType", "MenuButtonType",
"MessageEntityType", "MessageEntityType",

View file

@ -0,0 +1,12 @@
from enum import Enum
class KeyboardButtonPollTypeType(str, Enum):
"""
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
Source: https://core.telegram.org/bots/api#keyboardbuttonpolltype
"""
QUIZ = "quiz"
REGULAR = "regular"

View file

@ -21,6 +21,7 @@ Here is list of all available enums:
encrypted_passport_element encrypted_passport_element
inline_query_result_type inline_query_result_type
input_media_type input_media_type
keyboard_button_poll_type_type
mask_position_point mask_position_point
menu_button_type menu_button_type
message_entity_type message_entity_type

View file

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