How to use the aiogram.utils.helper.ListItem function in aiogram

To help you get started, we’ve selected a few aiogram examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aiogram / aiogram / tests / test_utils / test_helper.py View on Github external
def test_list_items_are_ordered(self):
        class MyOrderedHelper(OrderedHelper):
            A = ListItem()
            D = ListItem()
            C = ListItem()
            B = ListItem()

        assert MyOrderedHelper.all() == ["A", "D", "C", "B"]
github aiogram / aiogram / tests / test_utils / test_helper.py View on Github external
def test_list_items_are_ordered(self):
        class MyOrderedHelper(OrderedHelper):
            A = ListItem()
            D = ListItem()
            C = ListItem()
            B = ListItem()

        assert MyOrderedHelper.all() == ["A", "D", "C", "B"]
github aiogram / aiogram / aiogram / types / message.py View on Github external
:key: SUCCESSFUL_PAYMENT
    :key: CONNECTED_WEBSITE
    :key: MIGRATE_TO_CHAT_ID
    :key: MIGRATE_FROM_CHAT_ID
    :key: UNKNOWN
    :key: ANY
    """
    mode = helper.HelperMode.snake_case

    TEXT = helper.ListItem()  # text
    AUDIO = helper.ListItem()  # audio
    DOCUMENT = helper.ListItem()  # document
    ANIMATION = helper.ListItem()  # animation
    GAME = helper.ListItem()  # game
    PHOTO = helper.ListItem()  # photo
    STICKER = helper.ListItem()  # sticker
    VIDEO = helper.ListItem()  # video
    VIDEO_NOTE = helper.ListItem()  # video_note
    VOICE = helper.ListItem()  # voice
    CONTACT = helper.ListItem()  # contact
    LOCATION = helper.ListItem()  # location
    VENUE = helper.ListItem()  # venue
    NEW_CHAT_MEMBERS = helper.ListItem()  # new_chat_member
    LEFT_CHAT_MEMBER = helper.ListItem()  # left_chat_member
    INVOICE = helper.ListItem()  # invoice
    SUCCESSFUL_PAYMENT = helper.ListItem()  # successful_payment
    CONNECTED_WEBSITE = helper.ListItem()  # connected_website
    MIGRATE_TO_CHAT_ID = helper.ListItem()  # migrate_to_chat_id
    MIGRATE_FROM_CHAT_ID = helper.ListItem()  # migrate_from_chat_id
    PINNED_MESSAGE = helper.ListItem()  # pinned_message
    NEW_CHAT_TITLE = helper.ListItem()  # new_chat_title
    NEW_CHAT_PHOTO = helper.ListItem()  # new_chat_photo
github aiogram / aiogram / aiogram / types / update.py View on Github external
"""
    Helper for allowed_updates parameter in getUpdates and setWebhook methods.

    You can use &, + or | operators for make combination of allowed updates.

    Example:
        >>> bot.get_updates(allowed_updates=AllowedUpdates.MESSAGE + AllowedUpdates.EDITED_MESSAGE)
    """
    mode = helper.HelperMode.snake_case

    MESSAGE = helper.ListItem()  # message
    EDITED_MESSAGE = helper.ListItem()  # edited_message
    CHANNEL_POST = helper.ListItem()  # channel_post
    EDITED_CHANNEL_POST = helper.ListItem()  # edited_channel_post
    INLINE_QUERY = helper.ListItem()  # inline_query
    CHOSEN_INLINE_QUERY = helper.ListItem()  # chosen_inline_result
    CALLBACK_QUERY = helper.ListItem()  # callback_query
    SHIPPING_QUERY = helper.ListItem()  # shipping_query
    PRE_CHECKOUT_QUERY = helper.ListItem()  # pre_checkout_query
github aiogram / aiogram / aiogram / types / message.py View on Github external
:key: LOCATION
    :key: VENUE
    :key: NEW_CHAT_MEMBERS
    :key: LEFT_CHAT_MEMBER
    :key: INVOICE
    :key: SUCCESSFUL_PAYMENT
    :key: CONNECTED_WEBSITE
    :key: MIGRATE_TO_CHAT_ID
    :key: MIGRATE_FROM_CHAT_ID
    :key: UNKNOWN
    :key: ANY
    """
    mode = helper.HelperMode.snake_case

    TEXT = helper.ListItem()  # text
    AUDIO = helper.ListItem()  # audio
    DOCUMENT = helper.ListItem()  # document
    ANIMATION = helper.ListItem()  # animation
    GAME = helper.ListItem()  # game
    PHOTO = helper.ListItem()  # photo
    STICKER = helper.ListItem()  # sticker
    VIDEO = helper.ListItem()  # video
    VIDEO_NOTE = helper.ListItem()  # video_note
    VOICE = helper.ListItem()  # voice
    CONTACT = helper.ListItem()  # contact
    LOCATION = helper.ListItem()  # location
    VENUE = helper.ListItem()  # venue
    NEW_CHAT_MEMBERS = helper.ListItem()  # new_chat_member
    LEFT_CHAT_MEMBER = helper.ListItem()  # left_chat_member
    INVOICE = helper.ListItem()  # invoice
    SUCCESSFUL_PAYMENT = helper.ListItem()  # successful_payment
    CONNECTED_WEBSITE = helper.ListItem()  # connected_website
github aiogram / aiogram / aiogram / types / update.py View on Github external
You can use &, + or | operators for make combination of allowed updates.

    Example:
        >>> bot.get_updates(allowed_updates=AllowedUpdates.MESSAGE + AllowedUpdates.EDITED_MESSAGE)
    """
    mode = helper.HelperMode.snake_case

    MESSAGE = helper.ListItem()  # message
    EDITED_MESSAGE = helper.ListItem()  # edited_message
    CHANNEL_POST = helper.ListItem()  # channel_post
    EDITED_CHANNEL_POST = helper.ListItem()  # edited_channel_post
    INLINE_QUERY = helper.ListItem()  # inline_query
    CHOSEN_INLINE_QUERY = helper.ListItem()  # chosen_inline_result
    CALLBACK_QUERY = helper.ListItem()  # callback_query
    SHIPPING_QUERY = helper.ListItem()  # shipping_query
    PRE_CHECKOUT_QUERY = helper.ListItem()  # pre_checkout_query
github aiogram / aiogram / aiogram / types / message.py View on Github external
CONTACT = helper.ListItem()  # contact
    LOCATION = helper.ListItem()  # location
    VENUE = helper.ListItem()  # venue
    NEW_CHAT_MEMBERS = helper.ListItem()  # new_chat_member
    LEFT_CHAT_MEMBER = helper.ListItem()  # left_chat_member
    INVOICE = helper.ListItem()  # invoice
    SUCCESSFUL_PAYMENT = helper.ListItem()  # successful_payment
    CONNECTED_WEBSITE = helper.ListItem()  # connected_website
    MIGRATE_TO_CHAT_ID = helper.ListItem()  # migrate_to_chat_id
    MIGRATE_FROM_CHAT_ID = helper.ListItem()  # migrate_from_chat_id
    PINNED_MESSAGE = helper.ListItem()  # pinned_message
    NEW_CHAT_TITLE = helper.ListItem()  # new_chat_title
    NEW_CHAT_PHOTO = helper.ListItem()  # new_chat_photo
    DELETE_CHAT_PHOTO = helper.ListItem()  # delete_chat_photo
    GROUP_CHAT_CREATED = helper.ListItem()  # group_chat_created
    PASSPORT_DATA = helper.ListItem()  # passport_data

    UNKNOWN = helper.ListItem()  # unknown
    ANY = helper.ListItem()  # any


class ParseMode(helper.Helper):
    """
    Parse modes

    :key: MARKDOWN
    :key: HTML
    """

    mode = helper.HelperMode.lowercase

    MARKDOWN = helper.Item()
github aiogram / aiogram / aiogram / types / message.py View on Github external
ANIMATION = helper.ListItem()  # animation
    GAME = helper.ListItem()  # game
    PHOTO = helper.ListItem()  # photo
    STICKER = helper.ListItem()  # sticker
    VIDEO = helper.ListItem()  # video
    VIDEO_NOTE = helper.ListItem()  # video_note
    VOICE = helper.ListItem()  # voice
    CONTACT = helper.ListItem()  # contact
    LOCATION = helper.ListItem()  # location
    VENUE = helper.ListItem()  # venue
    NEW_CHAT_MEMBERS = helper.ListItem()  # new_chat_member
    LEFT_CHAT_MEMBER = helper.ListItem()  # left_chat_member
    INVOICE = helper.ListItem()  # invoice
    SUCCESSFUL_PAYMENT = helper.ListItem()  # successful_payment
    CONNECTED_WEBSITE = helper.ListItem()  # connected_website
    MIGRATE_TO_CHAT_ID = helper.ListItem()  # migrate_to_chat_id
    MIGRATE_FROM_CHAT_ID = helper.ListItem()  # migrate_from_chat_id
    PINNED_MESSAGE = helper.ListItem()  # pinned_message
    NEW_CHAT_TITLE = helper.ListItem()  # new_chat_title
    NEW_CHAT_PHOTO = helper.ListItem()  # new_chat_photo
    DELETE_CHAT_PHOTO = helper.ListItem()  # delete_chat_photo
    GROUP_CHAT_CREATED = helper.ListItem()  # group_chat_created
    PASSPORT_DATA = helper.ListItem()  # passport_data

    UNKNOWN = helper.ListItem()  # unknown
    ANY = helper.ListItem()  # any


class ParseMode(helper.Helper):
    """
    Parse modes
github aiogram / aiogram / aiogram / types / update.py View on Github external
Helper for allowed_updates parameter in getUpdates and setWebhook methods.

    You can use &, + or | operators for make combination of allowed updates.

    Example:
        >>> bot.get_updates(allowed_updates=AllowedUpdates.MESSAGE + AllowedUpdates.EDITED_MESSAGE)
    """
    mode = helper.HelperMode.snake_case

    MESSAGE = helper.ListItem()  # message
    EDITED_MESSAGE = helper.ListItem()  # edited_message
    CHANNEL_POST = helper.ListItem()  # channel_post
    EDITED_CHANNEL_POST = helper.ListItem()  # edited_channel_post
    INLINE_QUERY = helper.ListItem()  # inline_query
    CHOSEN_INLINE_QUERY = helper.ListItem()  # chosen_inline_result
    CALLBACK_QUERY = helper.ListItem()  # callback_query
    SHIPPING_QUERY = helper.ListItem()  # shipping_query
    PRE_CHECKOUT_QUERY = helper.ListItem()  # pre_checkout_query
github aiogram / aiogram / aiogram / types / message.py View on Github external
:key: LEFT_CHAT_MEMBER
    :key: INVOICE
    :key: SUCCESSFUL_PAYMENT
    :key: CONNECTED_WEBSITE
    :key: MIGRATE_TO_CHAT_ID
    :key: MIGRATE_FROM_CHAT_ID
    :key: UNKNOWN
    :key: ANY
    """
    mode = helper.HelperMode.snake_case

    TEXT = helper.ListItem()  # text
    AUDIO = helper.ListItem()  # audio
    DOCUMENT = helper.ListItem()  # document
    ANIMATION = helper.ListItem()  # animation
    GAME = helper.ListItem()  # game
    PHOTO = helper.ListItem()  # photo
    STICKER = helper.ListItem()  # sticker
    VIDEO = helper.ListItem()  # video
    VIDEO_NOTE = helper.ListItem()  # video_note
    VOICE = helper.ListItem()  # voice
    CONTACT = helper.ListItem()  # contact
    LOCATION = helper.ListItem()  # location
    VENUE = helper.ListItem()  # venue
    NEW_CHAT_MEMBERS = helper.ListItem()  # new_chat_member
    LEFT_CHAT_MEMBER = helper.ListItem()  # left_chat_member
    INVOICE = helper.ListItem()  # invoice
    SUCCESSFUL_PAYMENT = helper.ListItem()  # successful_payment
    CONNECTED_WEBSITE = helper.ListItem()  # connected_website
    MIGRATE_TO_CHAT_ID = helper.ListItem()  # migrate_to_chat_id
    MIGRATE_FROM_CHAT_ID = helper.ListItem()  # migrate_from_chat_id
    PINNED_MESSAGE = helper.ListItem()  # pinned_message