Skip to content

[FEATURE] Add telegram.ext.filters.Filters.poll for native poll messages #1672

@blueset

Description

@blueset

Is your feature request related to a problem? Please describe.

Since version 4.2, Bot API added poll message support, and PTB has also followed up with that in the API. However, as of PTB 12.2.0, ther is no support of poll messages in built in filters like other message types.

Describe the solution you'd like

Add a filter telegram.ext.filters.Filters.poll, namely:

    class _Poll(BaseFilter):
        name = 'Filters.poll'

        def filter(self, message):
            return bool(message.poll)

    poll = _Poll()
    """Messages that contain :class:`telegram.Poll`."""

Describe alternatives you've considered

I’m having this filter in my own code so far.

Additional context

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy